From 61820afa5d644116c93abc539ea63c3394ccfd01 Mon Sep 17 00:00:00 2001 From: ProxyMesh AI Date: Tue, 17 Mar 2026 13:41:02 +0000 Subject: [PATCH 1/2] ci: publish to npm on GitHub Release Publish on release.published using NPM_TOKEN, and fail fast if the tag doesn't match package.json version. Made-with: Cursor --- .github/workflows/release-npm.yml | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/release-npm.yml diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml new file mode 100644 index 0000000..df98d34 --- /dev/null +++ b/.github/workflows/release-npm.yml @@ -0,0 +1,45 @@ +name: Publish to npm on GitHub Release + +on: + release: + types: [published] + +permissions: + contents: read + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org + cache: npm + + - name: Ensure release tag matches package.json version + shell: bash + run: | + set -euo pipefail + PKG_VERSION="$(node -p "require('./package.json').version")" + TAG_NAME="${{ github.event.release.tag_name }}" + if [[ "$TAG_NAME" != "v$PKG_VERSION" && "$TAG_NAME" != "$PKG_VERSION" ]]; then + echo "Release tag '$TAG_NAME' does not match package.json version '$PKG_VERSION' (expected '$PKG_VERSION' or 'v$PKG_VERSION')." + exit 1 + fi + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --access public --provenance From 0403910e2b2ec69bcf78523af32b132bf54fece6 Mon Sep 17 00:00:00 2001 From: ProxyMesh <57071867+proxymesh@users.noreply.github.com> Date: Tue, 17 Mar 2026 06:44:16 -0700 Subject: [PATCH 2/2] Remove test step from release-npm workflow Removed the test execution step from the release workflow. --- .github/workflows/release-npm.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release-npm.yml b/.github/workflows/release-npm.yml index df98d34..fff68ce 100644 --- a/.github/workflows/release-npm.yml +++ b/.github/workflows/release-npm.yml @@ -36,9 +36,6 @@ jobs: - name: Install dependencies run: npm ci - - name: Run tests - run: npm test - - name: Publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}