Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: separate build and publish steps #1106

Merged
merged 2 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/workflows/dev-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,31 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- run: npm ci
- run: npm test
env:
FORCE_COLOR: 3
- run: node scripts/clean-package-json.mjs
- uses: actions/upload-artifact@v4
with:
name: build-${{ github.run_id }}
path: |
build
package.json
retention-days: 1

publish:
needs: build
runs-on: ubuntu-latest
permissions:
checks: read
Expand All @@ -20,14 +44,12 @@ jobs:
with:
node-version: 22
cache: 'npm'
- run: npm ci
- run: npm test
env:
FORCE_COLOR: 3
- uses: actions/download-artifact@v4
with:
name: build-${{ github.run_id }}
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
env:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
- run: |
npm version $(node --eval="process.stdout.write(require('./package.json').version)")-dev.$(git rev-parse --short HEAD) --no-git-tag-version
node scripts/clean-package-json.mjs
npm publish --provenance --access=public --no-git-tag-version --tag dev
32 changes: 27 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,31 @@ on:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- run: npm ci
- run: npm test
env:
FORCE_COLOR: 3
- run: node scripts/clean-package-json.mjs
- uses: actions/upload-artifact@v4
with:
name: build-${{ github.run_id }}
path: |
build
package.json
retention-days: 1

publish:
needs: build
runs-on: ubuntu-latest
permissions:
checks: read
Expand All @@ -22,11 +46,9 @@ jobs:
with:
node-version: 22
cache: 'npm'
- run: npm ci
- run: npm test
env:
FORCE_COLOR: 3
- run: node scripts/clean-package-json.mjs
- uses: actions/download-artifact@v4
with:
name: build-${{ github.run_id }}
- run: echo "//wombat-dressing-room.appspot.com/:_authToken=$AUTH_TOKEN" >> .npmrc
env:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
Expand Down
Loading
Loading