Skip to content

Commit 66c6f60

Browse files
authored
ci: add npm provenance and improve release workflow (#110)
This PR enhances our release workflow by: - Adding npm provenance support for package security - Configuring the npm registry URL in the GitHub workflow - Adding custom commit message and PR title for version updates - Setting public access and provenance in package.json - Removing the custom release script in favor of the changeset action These changes improve our publishing security and simplify the release process by leveraging GitHub Actions and changesets more effectively.
1 parent 4a5367c commit 66c6f60

File tree

4 files changed

+12
-59
lines changed

4 files changed

+12
-59
lines changed

.github/workflows/release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
99
permissions:
1010
contents: write
1111
pull-requests: write
12+
id-token: write # for npm provenance OIDC attestation
1213

1314
jobs:
1415
version:
@@ -27,6 +28,7 @@ jobs:
2728
with:
2829
node-version: 22
2930
cache: "pnpm"
31+
registry-url: "https://registry.npmjs.org"
3032

3133
- name: Install dependencies
3234
run: pnpm install --frozen-lockfile
@@ -35,7 +37,11 @@ jobs:
3537
id: changesets
3638
uses: changesets/action@v1
3739
with:
40+
commit: "chore: update versions"
41+
title: "chore: update versions"
3842
publish: pnpm ci:publish
3943
env:
4044
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4145
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
NPM_CONFIG_PROVENANCE: true

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"check": "pnpm --filter react-shiki check",
1717
"format": "pnpm --filter react-shiki format",
1818
"changeset": "changeset",
19-
"release": "node scripts/release.mjs",
2019
"ci:publish": "pnpm package:build && changeset publish"
2120
},
2221
"devDependencies": {

package/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@
2626
"type": "module",
2727
"main": "./dist/index.js",
2828
"types": "./dist/index.d.ts",
29-
"files": [
30-
"dist",
31-
"src/lib/styles.css"
32-
],
33-
"sideEffects": [
34-
"src/lib/styles.css"
35-
],
29+
"files": ["dist", "src/lib/styles.css"],
30+
"sideEffects": ["src/lib/styles.css"],
31+
"publishConfig": {
32+
"access": "public",
33+
"provenance": true
34+
},
3635
"exports": {
3736
".": {
3837
"types": "./dist/index.d.ts",

scripts/release.mjs

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)