forked from redwoodjs/redwood
-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.07 KB
/
create-pr-artifact.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Create PR Artifact
on: pull_request
jobs:
create_pr_artifact:
name: Create PR Artifact
if: github.repository == 'redwoodjs/redwood'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout PR
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 14
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn build
- name: Create packages
run: |
dirName="bin/${{ github.event.number }}"
mkdir -p $dirName
for d in packages/*/ ; do
(cd "$d" && tgz=$(npm pack) && cp $tgz "../../$dirName/")
done
cd $dirName
sha="${{ github.event.pull_request.head.sha }}"
for f in * ; do
mv -- "$f" "${f%.tgz}-${sha:0:7}.tgz"
done
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: pr-packages
path: bin/
retention-days: 1