Skip to content

Commit

Permalink
chore: Enable provenance (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 authored Dec 19, 2024
1 parent 03aec1c commit b18c5b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ jobs:
cd:
name: Deployment
runs-on: ubuntu-24.04
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for NPM provenance
needs:
- lint
- ci-core
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ on:
inputs:
version:
description: Base version to use for the release
required: true
type: string
default: '0.0.0'
env:
FORCE_COLOR: 3 # Diplay chalk colors

jobs:
snapshot:
name: Deployment
runs-on: ubuntu-24.04
permissions:
id-token: write # to enable use of OIDC for NPM provenance
steps:
- name: Generate snapshot version
id: version
Expand All @@ -29,15 +31,15 @@ jobs:
node-version-file: .node-version
cache: pnpm
- name: Install dependencies
run: pnpm install --ignore-scripts --frozen-lockfile
run: pnpm install --ignore-scripts --frozen-lockfile --filter nuqs...
- name: Build package
run: pnpm build --filter nuqs
- name: Publish package
working-directory: packages/nuqs
run: |
pnpm pkg set version=${{ steps.version.outputs.version }}
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
pnpm publish --access public --tag snapshot --no-git-checks
pnpm publish --access public --provenance --tag snapshot --no-git-checks
rm -f .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion packages/nuqs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"react-router"
],
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
},
"files": [
"dist/",
Expand Down

0 comments on commit b18c5b4

Please sign in to comment.