|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | build: |
| 10 | + if: startsWith(github.ref, 'refs/tags/') |
10 | 11 | runs-on: ubuntu-latest |
11 | 12 | permissions: |
12 | 13 | contents: write |
13 | 14 | id-token: write |
14 | 15 | steps: |
15 | | - - uses: actions/checkout@v4 |
16 | | - - uses: actions/setup-node@v4 |
| 16 | + - uses: actions/checkout@v5 |
| 17 | + - uses: actions/setup-node@v5 |
17 | 18 | with: |
18 | | - node-version: "22" |
| 19 | + node-version: "24" |
19 | 20 | registry-url: "https://registry.npmjs.com/" |
20 | 21 | - run: npm ci |
| 22 | + - name: Read package.json |
| 23 | + id: package |
| 24 | + uses: RadovanPelka/github-action-json@main |
| 25 | + with: |
| 26 | + path: "package.json" |
| 27 | + - name: Remove old builds |
| 28 | + run: | |
| 29 | + rm -rf *.tgz |
21 | 30 | - name: Publish to npmjs.com |
22 | | - if: startsWith(github.ref, 'refs/tags/') |
| 31 | + if: steps.package.outputs.private == '' || steps.package.outputs.private == 'false' || steps.package.outputs.private == false |
23 | 32 | run: npm publish --provenance --access public |
24 | 33 | env: |
25 | 34 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
26 | | - - name: Pack |
27 | | - uses: softprops/action-gh-release@v2 |
28 | | - if: startsWith(github.ref, 'refs/tags/') |
29 | | - with: |
30 | | - files: "*.tar.gz" |
31 | 35 | - name: Create package |
32 | | - if: startsWith(github.ref, 'refs/tags/') |
33 | 36 | run: | |
34 | | - rm -rf *.tgz |
35 | 37 | npm pack |
36 | | - - name: Check file existence |
37 | | - id: check_files |
38 | | - uses: andstor/file-existence-action@v3 |
| 38 | + - name: Publish to GitHub Release |
| 39 | + uses: softprops/action-gh-release@v2 |
39 | 40 | with: |
40 | 41 | files: "*.tgz" |
41 | | - - name: On Build Failure |
42 | | - if: steps.check_files.outputs.files_exists == 'false' |
43 | | - run: | |
44 | | - echo "Packaging FAILED" && exit 1 |
| 42 | + fail_on_unmatched_files: true |
0 commit comments