Skip to content

Commit

Permalink
ci: enable npm provenance (#10164)
Browse files Browse the repository at this point in the history
* chore: enable npm provenance

* chore: do the same for dev releases

* chore: actually enable it in normal releases

* chore: specify provenance in `package.json`

* chore: remove `publishConfig` from api-extractor-utils as it's `private`
  • Loading branch information
SuperchupuDev authored Mar 4, 2024
1 parent a1010c6 commit a66fc65
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
- package: '@discordjs/ws'
folder: 'ws'
runs-on: ubuntu-latest
permissions:
id-token: write
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
Expand Down Expand Up @@ -71,7 +73,7 @@ jobs:
if: steps.release-check.outputs.release == '1'
run: |
pnpm --filter=${{ matrix.package }} run release --preid "dev.$(date +%s)-$(git rev-parse --short HEAD)"
pnpm --filter=${{ matrix.package }} publish --no-git-checks --tag dev || true
pnpm --filter=${{ matrix.package }} publish --provenance --no-git-checks --tag dev || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ jobs:
npm-publish:
name: npm publish
runs-on: ubuntu-latest
permissions:
id-token: write
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
Expand Down Expand Up @@ -34,6 +36,6 @@ jobs:

- name: Publish package
run: |
pnpm --filter=${{ steps.extract-tag.outputs.subpackage == 'true' && '@discordjs/' || '' }}${{ steps.extract-tag.outputs.package }} publish --no-git-checks
pnpm --filter=${{ steps.extract-tag.outputs.subpackage == 'true' && '@discordjs/' || '' }}${{ steps.extract-tag.outputs.package }} publish --provenance --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
3 changes: 0 additions & 3 deletions packages/api-extractor-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,5 @@
},
"engines": {
"node": ">=18"
},
"publishConfig": {
"access": "public"
}
}
3 changes: 2 additions & 1 deletion packages/brokers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/builders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"node": ">=16.11.0"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/collection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/create-discord-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 3 additions & 0 deletions packages/discord.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,8 @@
},
"engines": {
"node": ">=16.11.0"
},
"publishConfig": {
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/docgen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/formatters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"node": ">=16.11.0"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/proxy-container/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"node": ">=16.11.0"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/scripts/turbo/generators/templates/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"node": ">=18"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
"node": ">=16.11.0"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
},
"tsd": {
"directory": "__tests__/types"
Expand Down
3 changes: 2 additions & 1 deletion packages/voice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"node": ">=16.11.0"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}
3 changes: 2 additions & 1 deletion packages/ws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"node": ">=16.11.0"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}

0 comments on commit a66fc65

Please sign in to comment.