|
4 | 4 | push: |
5 | 5 | tags: |
6 | 6 | - "[0-9]+.[0-9]+.[0-9]+" |
7 | | -env: |
8 | | - CI_RUN: true |
| 7 | + |
9 | 8 | jobs: |
10 | | - publish-npm: |
| 9 | + test: |
11 | 10 | runs-on: ubuntu-latest |
12 | 11 | permissions: |
13 | 12 | contents: read |
14 | | - id-token: write |
| 13 | + env: |
| 14 | + CI_RUN: true |
15 | 15 | steps: |
16 | | - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 16 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 17 | + with: |
| 18 | + persist-credentials: false |
17 | 19 | - uses: ./.github/actions/prepare-runner |
| 20 | + - run: pnpm test |
| 21 | + |
| 22 | + build: # Separate job so build-time dependencies can't publish |
| 23 | + runs-on: ubuntu-latest |
| 24 | + permissions: |
| 25 | + contents: read |
| 26 | + env: |
| 27 | + CI_RUN: true |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 30 | + with: |
| 31 | + persist-credentials: false |
| 32 | + - name: Install Node.js |
| 33 | + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 34 | + with: |
| 35 | + node-version: 24 |
| 36 | + package-manager-cache: false # Slower, but no cache poisoning risk |
| 37 | + - name: Enable Corepack and pnpm |
| 38 | + shell: bash |
| 39 | + run: | |
| 40 | + corepack enable |
| 41 | + corepack install |
| 42 | + - run: pnpm install --frozen-lockfile --ignore-scripts |
18 | 43 | - run: pnpm --filter nanotags build |
19 | 44 | - run: cp README.md LICENSE.md packages/nanotags/ |
20 | | - - run: pnpm --filter nanotags publish --no-git-checks --provenance |
| 45 | + - name: Upload build artifacts |
| 46 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 47 | + with: |
| 48 | + name: build-artifacts |
| 49 | + path: | |
| 50 | + packages/nanotags/dist/ |
| 51 | + packages/nanotags/README.md |
| 52 | + packages/nanotags/LICENSE.md |
| 53 | + if-no-files-found: error |
| 54 | + retention-days: 1 |
| 55 | + |
| 56 | + publish: # The critical job: no dependencies installed at all |
| 57 | + runs-on: ubuntu-latest |
| 58 | + needs: |
| 59 | + - test |
| 60 | + - build |
| 61 | + permissions: |
| 62 | + contents: read |
| 63 | + id-token: write |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 66 | + with: |
| 67 | + persist-credentials: false |
| 68 | + - name: Download build artifacts |
| 69 | + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 70 | + with: |
| 71 | + name: build-artifacts |
| 72 | + path: packages/nanotags |
| 73 | + - name: Install Node.js |
| 74 | + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 75 | + with: |
| 76 | + node-version: 26 # Bundles npm 11.17+, which has `npm stage` |
| 77 | + package-manager-cache: false |
| 78 | + - name: Stage npm release for manual approval |
| 79 | + working-directory: packages/nanotags |
| 80 | + run: npm stage publish --ignore-scripts |
0 commit comments