diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb4a794..9861a5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,13 +17,13 @@ jobs: - "22" - "*" steps: - - uses: actions/checkout@v5 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test - - uses: codecov/codecov-action@v5 + - uses: codecov/codecov-action@v7 with: name: Node.js ${{ matrix.node-version }} token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..36a5388 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: release + +on: + push: + tags: + - "v*.*.*" + +permissions: + id-token: write # Required for NPM trusted publishing. + contents: read + +jobs: + npm: + name: Publish to npm + runs-on: ubuntu-latest + environment: + name: release + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: latest + package-manager-cache: false # Disable automatic npm dependency caching to reduce cache poisoning risk + - run: npm ci --ignore-scripts + - run: npm test + - run: npm stage publish # Runs prepublish script.