|
6 | 6 | - 'v*' |
7 | 7 |
|
8 | 8 | permissions: |
9 | | - id-token: write |
10 | | - contents: write |
11 | | - attestations: write |
12 | | - |
| 9 | + contents: read |
| 10 | + id-token: write # Required for npm provenance |
| 11 | + |
13 | 12 | jobs: |
14 | 13 | publish: |
15 | 14 | runs-on: ubuntu-latest |
| 15 | + permissions: |
| 16 | + contents: write # Required for creating releases |
| 17 | + id-token: write # Required for npm provenance |
| 18 | + attestations: write # Required for SLSA attestations |
16 | 19 | steps: |
17 | 20 | - name: Harden Runner |
18 | 21 | uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.12.0 |
|
53 | 56 | - run: npm run build --if-present |
54 | 57 | - run: npm test |
55 | 58 |
|
56 | | - - name: Publish with provenance |
57 | | - run: npm publish --provenance --access public |
58 | | - env: |
59 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
60 | | - |
61 | 59 | - name: Create package tarball and set version |
62 | 60 | run: | |
63 | 61 | npm pack |
|
69 | 67 | # Download minisign with checksum verification |
70 | 68 | curl -LO https://github.com/jedisct1/minisign/releases/download/0.12/minisign-0.12-linux.tar.gz |
71 | 69 | curl -LO https://github.com/jedisct1/minisign/releases/download/0.12/minisign-0.12-linux.tar.gz.sha256 |
| 70 | + # Fix checksum format (file contains only hash, not "hash filename" format) |
| 71 | + echo "$(cat minisign-0.12-linux.tar.gz.sha256) minisign-0.12-linux.tar.gz" > minisign-0.12-linux.tar.gz.sha256 |
72 | 72 | sha256sum -c minisign-0.12-linux.tar.gz.sha256 |
73 | 73 | tar xzf minisign-0.12-linux.tar.gz |
74 | 74 | sudo mv minisign-linux/x86_64/minisign /usr/local/bin/ |
@@ -135,10 +135,14 @@ jobs: |
135 | 135 | find . -name "*.intoto.jsonl" -exec minisign -Sm {} -s minisign.key -t "SLSA Attestation for create-claude v$VERSION" \; |
136 | 136 | find . -name "*.intoto.jsonl" -exec gpg --armor --detach-sign --output {}.asc {} \; |
137 | 137 | |
138 | | - - name: Cleanup sensitive files and temporary artifacts |
| 138 | + - name: Cleanup sensitive files |
139 | 139 | run: | |
140 | 140 | rm -f minisign.key |
141 | | - rm -f *.tar.gz *.sha256 |
| 141 | + |
| 142 | + - name: Publish with provenance to NPM |
| 143 | + run: npm publish --provenance --access public |
| 144 | + env: |
| 145 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
142 | 146 |
|
143 | 147 | - name: Create comprehensive GitHub Release |
144 | 148 | uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.3.2 |
|
0 commit comments