ci: npm publish with provenance (#1582)

* npm publish with provenance

* update token to allow creating id-token
This commit is contained in:
Jacob Bolda authored and GitHub committed 2024-07-24 16:40:11 +03:00
1 parent 20a1d24ee0
commit bb09c7ca6e
3 files changed
+27 -1

No files matched your search

+11 -1
View File
@@ -9,7 +9,17 @@
"url": "https://registry.npmjs.com/${ pkg.pkgFile.pkg.name }/${ pkg.pkgFile.version }" "url": "https://registry.npmjs.com/${ pkg.pkgFile.pkg.name }/${ pkg.pkgFile.version }"
} }
}, },
"publish": ["pnpm build", "pnpm publish --access public --no-git-checks"] "publish": [
{
"command": "pnpm build",
"dryRunCommand": "pnpm build"
},
{
"command": "npm publish --provenance --access public",
"dryRunCommand": "npm publish --provenance --access public --dry-run",
"pipe": true
}
]
}, },
"rust": { "rust": {
"version": true, "version": true,
@@ -9,6 +9,14 @@ on:
branches: branches:
- v2 - v2
permissions:
# required for npm provenance
id-token: write
# required to create the GitHub Release
contents: write
# required for creating the Version Packages Release
pull-requests: write
jobs: jobs:
version-or-publish: version-or-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -9,6 +9,14 @@ on:
branches: branches:
- v1 - v1
permissions:
# required for npm provenance
id-token: write
# required to create the GitHub Release
contents: write
# required for creating the Version Packages Release
pull-requests: write
jobs: jobs:
version-or-publish: version-or-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest