From d555a1865f6f3a5d5067419daa4fe0b24fd97e9b Mon Sep 17 00:00:00 2001 From: filmaj Date: Tue, 23 Dec 2025 14:28:35 -0500 Subject: [PATCH] chore: move to oidc npm publishing --- .github/workflows/build.yml | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3856750..d55dce3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,16 +15,16 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [ 16.x, 18.x, 20.x ] + node-version: [ 20.x, 22.x, 24.x ] os: [ windows-latest, ubuntu-latest, macOS-latest ] # Go steps: - name: Check out repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 - - name: Set up Node.js - uses: actions/setup-node@v4 + - name: Set up Node.js + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} @@ -40,14 +40,7 @@ jobs: - name: Install run: npm i - - name: Test (Node.js <= 16.x) - if: matrix.node-version <= '16.x' - run: npm run test:nolint - env: - CI: true - - name: Test - if: matrix.node-version > '16.x' run: npm test env: CI: true @@ -55,7 +48,7 @@ jobs: - name: Notify uses: sarisia/actions-status-discord@v1 # Only fire alert once - if: github.ref == 'refs/heads/main' && failure() && matrix.node-version == '20.x' && matrix.os == 'ubuntu-latest' + if: github.ref == 'refs/heads/main' && failure() && matrix.node-version == '24.x' && matrix.os == 'ubuntu-latest' with: webhook: ${{ secrets.DISCORD_WEBHOOK }} title: "build and test" @@ -67,6 +60,9 @@ jobs: # Publish to package registries publish: # Setup + permissions: + id-token: write # Required for OIDC + contents: read needs: build if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest @@ -74,26 +70,22 @@ jobs: # Go steps: - name: Check out repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - node-version: lts/* + node-version: 24.x registry-url: https://registry.npmjs.org/ # Publish to npm - name: Publish @RC to npm if: contains(github.ref, 'RC') run: npm publish --tag RC - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish @latest to npm if: contains(github.ref, 'RC') == false #'!contains()'' doesn't work lol run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Notify uses: sarisia/actions-status-discord@v1