diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index db9a041..db0947b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,23 +1,27 @@ -name: npm publish +name: Publish Package on: - release: - types: [published] + release: + types: [published] + +permissions: + id-token: write # Required for OIDC + contents: read jobs: - publish: - runs-on: ubuntu-latest + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: 14.x + registry-url: 'https://registry.npmjs.org' - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14.x - uses: actions/setup-node@v4.4.0 - with: - node-version: 14.x - cache: 'npm' - registry-url: 'https://registry.npmjs.org' - - run: npm ci - - run: npm run build - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # Ensure npm 11.5.1 or later is installed + - name: Update npm + run: npm install -g npm@latest + - run: npm ci + - run: npm run build --if-present + - run: npm publish \ No newline at end of file