Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(*): Publish packages with npm provenance #1891

Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/fast-planes-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'gatsby-plugin-clerk': patch
'@clerk/chrome-extension': patch
'@clerk/localizations': patch
'@clerk/clerk-js': patch
'@clerk/clerk-sdk-node': patch
'@clerk/backend': patch
'@clerk/fastify': patch
'@clerk/nextjs': patch
'@clerk/shared': patch
'@clerk/themes': patch
'@clerk/clerk-react': patch
'@clerk/remix': patch
'@clerk/types': patch
'@clerk/clerk-expo': patch
---

Publish packages with [npm provenance](https://docs.npmjs.com/generating-provenance-statements) enabled
5 changes: 5 additions & 0 deletions .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jobs:
name: Release
if: ${{ github.repository == 'clerkinc/javascript' }}
runs-on: ${{ vars.RUNNER_LARGE }}
env:
NPM_CONFIG_PROVENANCE: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 We might be able to add provenance=true to the root .npmrc file in the repo, instead of needing to add the environment variable to each release workflow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LekoArts It looks like that error might have been because the id-token permission wasn't set yet 👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

permissions:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contents: read
id-token: write
steps:
- name: Echo github context
run: echo "$GITHUB_CONTEXT"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
NPM_CONFIG_PROVENANCE: true
permissions:
contents: read
id-token: write
steps:
- name: Limit action to Clerk members
uses: actions/github-script@v6
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
NPM_CONFIG_PROVENANCE: true
permissions:
contents: read
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ module.exports = {
'subject-case': [2, 'always', ['sentence-case']],
'body-max-line-length': [1, 'always', '150'],
'scope-empty': [2, 'never'],
'scope-enum': [2, 'always', [...getPackageNames(), 'repo', 'release']],
'scope-enum': [2, 'always', [...getPackageNames(), 'repo', 'release', '*']],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to write a commit message that affects everything inside packages, we should use *. So this just adds it as it was missing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was missing, indeed! Great job!

},
};
3 changes: 2 additions & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"homepage": "https://clerk.com/",
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/backend"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
3 changes: 2 additions & 1 deletion packages/chrome-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/chrome-extension"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
3 changes: 2 additions & 1 deletion packages/clerk-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
"browserslist": "last 2 versions, ios_saf > 12, Safari > 12, > 1%, not dead, not ie > 0",
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/clerk-js"
},
"homepage": "https://clerk.com/",
"bugs": {
Expand Down
3 changes: 2 additions & 1 deletion packages/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/expo"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
3 changes: 2 additions & 1 deletion packages/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/fastify"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
3 changes: 2 additions & 1 deletion packages/gatsby-plugin-clerk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/gatsby-plugin-clerk"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
3 changes: 2 additions & 1 deletion packages/localizations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/localizations"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
3 changes: 2 additions & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/nextjs"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
3 changes: 2 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/react"
},
"homepage": "https://clerk.com/",
"bugs": {
Expand Down
3 changes: 2 additions & 1 deletion packages/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/remix"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
5 changes: 3 additions & 2 deletions packages/sdk-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"author": {
"name": "Clerk, Inc.",
"email": "support@clerk.com",
"url": "https://github.com/clerkinc/clerk-sdk-node"
"url": "git+https://github.com/clerkinc/javascript.git"
},
"devDependencies": {
"nock": "^13.0.7",
Expand All @@ -73,7 +73,8 @@
"description": "Clerk server SDK for usage with node",
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/sdk-node"
},
"keywords": [
"clerk",
Expand Down
5 changes: 5 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,10 @@
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/shared"
}
}
3 changes: 2 additions & 1 deletion packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/themes"
},
"bugs": {
"url": "https://github.com/clerkinc/javascript/issues"
Expand Down
3 changes: 2 additions & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/clerkinc/javascript.git"
"url": "git+https://github.com/clerkinc/javascript.git",
"directory": "packages/types"
},
"homepage": "https://clerk.com/",
"bugs": {
Expand Down
Loading