From 3e1deb6d92ab3ef0c3470d788280af2345083828 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 11 Aug 2026 15:05:56 +0000 Subject: [PATCH] Update npmpublish workflow: OIDC, tag trigger, Node 24, npm commands Co-authored-by: eggman64 <2733735+eggman64@users.noreply.github.com> --- .github/workflows/npmpublish.yml | 52 ++++++++++---------------------- 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index a7b1038..b17ed95 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -1,46 +1,26 @@ name: Publish Package on: - release: - types: [created] + push: + tags: + - 'v*' + +permissions: + id-token: write # Required for OIDC + contents: read jobs: publish: runs-on: ubuntu-latest - env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - name: Setup Node.js - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: - node-version: 'lts/*' - registry-url: https://registry.npmjs.org/ - cache: 'npm' - - - name: Install dependencies - run: make install - - - name: Build project - run: make build - - - name: Run linting - run: make lint - - - name: Run tests - run: make test - - - name: Publish package - if: ${{ env.NPM_TOKEN != '' }} - run: make publish - env: - NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }} - - - name: Publish package (legacy token fallback) - if: ${{ env.NPM_TOKEN == '' }} - run: make publish - env: - NODE_AUTH_TOKEN: ${{ env.NPM_AUTH_TOKEN }} + node-version: '24' + registry-url: 'https://registry.npmjs.org' + package-manager-cache: false # never use caching in release builds + - run: npm ci + - run: npm run build --if-present + - run: npm test + - run: npm publish