From 20490f499d92f0b2d537c274cded44ec4ca0912e Mon Sep 17 00:00:00 2001 From: Jason2866 Date: Wed, 11 Mar 2026 23:07:57 +0100 Subject: [PATCH] update GH action --- .github/workflows/publish.yml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1a76dd2..4c2a31e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,30 +1,37 @@ -name: Publish to npm + +name: Build and upload to NPM on: - release: - types: [published] + push: + workflow_dispatch: -permissions: - id-token: write - contents: read +# Allow one concurrent deployment +concurrency: + group: environment-${{ github.ref }} + cancel-in-progress: true jobs: - publish: + build: runs-on: ubuntu-latest permissions: contents: write id-token: write # required to use OIDC steps: - uses: actions/checkout@v6 - - - uses: actions/setup-node@v4 + - name: install node v22 + uses: actions/setup-node@v6 with: node-version: 22 - registry-url: https://registry.npmjs.org + registry-url: 'https://registry.npmjs.org' + - name: Update npm to latest + run: npm install -g npm@latest + - name: Check npm version + run: npm --version + - name: Install NPM + run: npm install + - name: Compile + run: npm run build - - run: npm install -g npm@latest - - run: npm install - - run: npm run build - name: Publish to NPM registry (OIDC Trusted Publishing) uses: JS-DevTools/npm-publish@v4 with: