Skip to content

Commit 5f48c73

Browse files
authored
ci: separate build and publish steps (#1106)
* chore: up dev deps * ci: separate build and publish steps
1 parent be0990f commit 5f48c73

File tree

4 files changed

+241
-68
lines changed

4 files changed

+241
-68
lines changed

.github/workflows/dev-publish.yml

+27-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,31 @@ on:
44
workflow_dispatch:
55

66
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
persist-credentials: false
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 22
16+
cache: 'npm'
17+
- run: npm ci
18+
- run: npm test
19+
env:
20+
FORCE_COLOR: 3
21+
- run: node scripts/clean-package-json.mjs
22+
- uses: actions/upload-artifact@v4
23+
with:
24+
name: build-${{ github.run_id }}
25+
path: |
26+
build
27+
package.json
28+
retention-days: 1
29+
730
publish:
31+
needs: build
832
runs-on: ubuntu-latest
933
permissions:
1034
checks: read
@@ -20,14 +44,12 @@ jobs:
2044
with:
2145
node-version: 22
2246
cache: 'npm'
23-
- run: npm ci
24-
- run: npm test
25-
env:
26-
FORCE_COLOR: 3
47+
- uses: actions/download-artifact@v4
48+
with:
49+
name: build-${{ github.run_id }}
2750
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
2851
env:
2952
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
3053
- run: |
3154
npm version $(node --eval="process.stdout.write(require('./package.json').version)")-dev.$(git rev-parse --short HEAD) --no-git-tag-version
32-
node scripts/clean-package-json.mjs
3355
npm publish --provenance --access=public --no-git-tag-version --tag dev

.github/workflows/npm-publish.yml

+27-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,31 @@ on:
66
types: [created]
77

88
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
persist-credentials: false
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 22
18+
cache: 'npm'
19+
- run: npm ci
20+
- run: npm test
21+
env:
22+
FORCE_COLOR: 3
23+
- run: node scripts/clean-package-json.mjs
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: build-${{ github.run_id }}
27+
path: |
28+
build
29+
package.json
30+
retention-days: 1
31+
932
publish:
33+
needs: build
1034
runs-on: ubuntu-latest
1135
permissions:
1236
checks: read
@@ -22,11 +46,9 @@ jobs:
2246
with:
2347
node-version: 22
2448
cache: 'npm'
25-
- run: npm ci
26-
- run: npm test
27-
env:
28-
FORCE_COLOR: 3
29-
- run: node scripts/clean-package-json.mjs
49+
- uses: actions/download-artifact@v4
50+
with:
51+
name: build-${{ github.run_id }}
3052
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
3153
env:
3254
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}

0 commit comments

Comments
 (0)