|
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - '**' |
| 8 | +env: |
| 9 | + # renovate: datasource=npm depName=npm |
| 10 | + NPM_VERSION: '11' |
| 11 | + |
8 | 12 | jobs: |
9 | 13 | build: |
10 | 14 | runs-on: ubuntu-latest |
11 | 15 | permissions: |
12 | 16 | contents: read |
13 | | - packages: write |
14 | 17 | steps: |
15 | 18 | - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 |
16 | 19 | - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 |
17 | 20 | with: |
18 | 21 | node-version: '24.x' |
19 | | - registry-url: 'https://registry.npmjs.org' |
20 | 22 | cache: npm |
21 | | - - run: npm install -g npm@11 --registry=https://registry.npmjs.org |
| 23 | + - run: npm install -g npm@${{ env.NPM_VERSION }} --registry=https://registry.npmjs.org |
22 | 24 | - uses: microbit-foundation/npm-package-versioner-action@v3 |
23 | 25 | - run: npm ci |
24 | | - env: |
25 | | - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
26 | 26 | - run: npm run ci |
27 | | - - name: Upload GitHub packages artifact |
28 | | - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5 |
| 27 | + - run: npm pack |
| 28 | + if: github.event_name == 'release' |
| 29 | + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 30 | + if: github.event_name == 'release' |
| 31 | + with: |
| 32 | + name: npm-tarball |
| 33 | + path: '*.tgz' |
| 34 | + if-no-files-found: error |
| 35 | + retention-days: 1 |
| 36 | + |
| 37 | + publish: |
| 38 | + needs: build |
| 39 | + if: github.event_name == 'release' |
| 40 | + runs-on: ubuntu-latest |
| 41 | + environment: npm-publish |
| 42 | + permissions: |
| 43 | + contents: read |
| 44 | + id-token: write |
| 45 | + steps: |
| 46 | + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 47 | + with: |
| 48 | + name: npm-tarball |
| 49 | + - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 |
29 | 50 | with: |
30 | | - path: ./storybook-static |
31 | | - - run: npm publish --allow-directory=all |
32 | | - if: github.event_name == 'release' && github.event.action == 'created' |
33 | | - env: |
34 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 51 | + node-version: '24.x' |
| 52 | + registry-url: 'https://registry.npmjs.org' |
| 53 | + - run: npm install -g npm@${{ env.NPM_VERSION }} --registry=https://registry.npmjs.org |
| 54 | + - run: npm stage publish --allow-file=all ./*.tgz |
0 commit comments