-
Notifications
You must be signed in to change notification settings - Fork 412
Add publication workflow for npmjs.com #782
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| --- | ||
| name: Publish to npmjs.com | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v[0-9]+.[0-9]+.[0-9]+*' | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| publish: | ||
| environment: release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| actions: write # required to trigger bump-api-diff-baseline.yml via `gh workflow run` | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| - name: Use Node.js 26 | ||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: 26.x | ||
|
jdmarshall marked this conversation as resolved.
|
||
| - name: Verify release secrets | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| run: | | ||
| fail() { | ||
| echo "::error::$1" | ||
| echo "::error::Fix: see '$2' in RELEASING.md" | ||
| exit 1 | ||
| } | ||
|
|
||
| # NPM token check | ||
| if [ -z "${NODE_AUTH_TOKEN}" ]; then | ||
| fail "No secret key available after import." | ||
| fi | ||
|
|
||
| - run: npm i | ||
|
jdmarshall marked this conversation as resolved.
|
||
| - run: npm test | ||
| - run: npm publish --provenance --access public --tag alpha | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you planning to remove #782 (review) had some fancier tag logic.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. That seemed to be the simplest solution. Push alphas until we are ready to publish. Until or unless there's a major upheaval of the code, say for native histograms, there's no need to do anything but trunk-based releases that I can see. |
||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| package-lock=false | ||
| min-release-age=2 | ||
|
jdmarshall marked this conversation as resolved.
|
||
| registry=https://registry.npmjs.org/ | ||
|
jdmarshall marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.