Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
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
Comment thread
jdmarshall marked this conversation as resolved.
Comment thread
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
Comment thread
jdmarshall marked this conversation as resolved.
- run: npm test
- run: npm publish --provenance --access public --tag alpha

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Are you planning to remove --tag alpha once v16 is ready to go?

#782 (review) had some fancier tag logic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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 }}
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package-lock=false
min-release-age=2
Comment thread
jdmarshall marked this conversation as resolved.
registry=https://registry.npmjs.org/
Comment thread
jdmarshall marked this conversation as resolved.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@prometheus/client",
"version": "15.1.3",
"version": "0.16.0-alpha.0",
"description": "Client for prometheus",
"main": "index.js",
"files": [
Expand Down
Loading