|
4 | 4 | release: |
5 | 5 | types: [created] |
6 | 6 |
|
7 | | -permissions: |
8 | | - id-token: write # Required for OIDC provenance attestations |
9 | | - contents: write # Required to push version bump commit |
| 7 | +permissions: {} |
10 | 8 |
|
11 | 9 | jobs: |
12 | | - publish-npm: |
| 10 | + test: |
13 | 11 | runs-on: ubuntu-latest |
| 12 | + permissions: {} |
14 | 13 | steps: |
15 | | - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6 |
16 | | - - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6 |
17 | | - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
| 14 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 |
| 15 | + with: |
| 16 | + persist-credentials: false |
| 17 | + - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 |
| 18 | + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6 |
| 19 | + with: |
| 20 | + node-version: 24 |
| 21 | + package-manager-cache: false |
| 22 | + - run: pnpm install --frozen-lockfile |
| 23 | + - run: pnpm test |
| 24 | + |
| 25 | + build: |
| 26 | + needs: test |
| 27 | + runs-on: ubuntu-latest |
| 28 | + permissions: {} |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 |
| 31 | + with: |
| 32 | + persist-credentials: false |
| 33 | + - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 |
| 34 | + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6 |
18 | 35 | with: |
19 | 36 | node-version: 24 |
20 | | - registry-url: https://registry.npmjs.org |
| 37 | + package-manager-cache: false |
21 | 38 | - run: pnpm install --frozen-lockfile |
22 | | - - run: pnpm exec playwright install chromium --only-shell |
23 | | - - run: pnpm test --forbid-only |
24 | 39 | - run: pnpm run build |
25 | | - - name: Bump version in package.json |
26 | | - env: |
27 | | - TAG_NAME: ${{ github.event.release.tag_name }} |
28 | | - run: pnpm version "${TAG_NAME#v}" --no-git-tag-version |
| 40 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 41 | + with: |
| 42 | + name: dist |
| 43 | + path: dist/ |
| 44 | + |
| 45 | + bump-version: |
| 46 | + needs: build |
| 47 | + runs-on: ubuntu-latest |
| 48 | + permissions: |
| 49 | + contents: write |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 |
| 52 | + with: |
| 53 | + persist-credentials: true |
| 54 | + - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 |
| 55 | + - run: | |
| 56 | + VERSION=${GITHUB_REF_NAME#v} |
| 57 | + pnpm version $VERSION --no-git-tag-version |
29 | 58 | - name: Commit and push version bump |
30 | 59 | env: |
31 | | - TAG_NAME: ${{ github.event.release.tag_name }} |
32 | | - DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} |
| 60 | + DEFAULT_BRANCH: main |
33 | 61 | run: | |
34 | 62 | git config user.name "github-actions[bot]" |
35 | 63 | git config user.email "github-actions[bot]@users.noreply.github.com" |
36 | 64 | git add package.json pnpm-lock.yaml |
37 | | - git commit -m "chore: bump version to ${TAG_NAME}" |
38 | | - git push origin HEAD:${DEFAULT_BRANCH} |
| 65 | + git commit -m "chore: bump version to ${GITHUB_REF_NAME#v}" |
| 66 | + git push origin HEAD:$DEFAULT_BRANCH |
| 67 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 68 | + with: |
| 69 | + name: package-json |
| 70 | + path: package.json |
| 71 | + |
| 72 | + publish: |
| 73 | + needs: bump-version |
| 74 | + runs-on: ubuntu-latest |
| 75 | + permissions: |
| 76 | + id-token: write # Required for OIDC provenance |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 |
| 79 | + with: |
| 80 | + persist-credentials: false |
| 81 | + - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 |
| 82 | + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6 |
| 83 | + with: |
| 84 | + node-version: 24 |
| 85 | + package-manager-cache: false |
| 86 | + registry-url: 'https://registry.npmjs.org' |
| 87 | + - run: pnpm install --frozen-lockfile |
| 88 | + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 89 | + with: |
| 90 | + name: dist |
| 91 | + path: dist/ |
| 92 | + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 93 | + with: |
| 94 | + name: package-json |
39 | 95 | - run: pnpm publish --no-git-checks |
0 commit comments