diff --git a/.github/workflows/nodejs-ci-action.yml b/.github/workflows/nodejs-ci-action.yml index e553103..a07fada 100644 --- a/.github/workflows/nodejs-ci-action.yml +++ b/.github/workflows/nodejs-ci-action.yml @@ -1,20 +1,23 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - name: Node.js CI on: - push: - branches: [ main ] pull_request: - branches: [ main ] + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: nodejs-ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: build: - runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node-version: [20.x, 22.x, 24.x] @@ -24,12 +27,26 @@ jobs: uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} + - run: npm ci - run: npm test + - run: npx @pkgjs/support@latest validate - run: npm run coverage - - name: upload coverage to Coveralls - uses: coverallsapp/github-action@master + + - name: Upload Coveralls Parallel + uses: coverallsapp/github-action@v2 with: - github-token: ${{ secrets.github_token }} + github-token: ${{ secrets.GITHUB_TOKEN }} flag-name: run-${{ matrix.node-version }} - - run: npx @pkgjs/support validate + parallel: true + + finish: + name: Node.js CI + needs: build + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 3855428..4604476 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,31 +1,38 @@ -on: - push: - branches: - - main name: release-please +on: + push: + branches: + - main + +permissions: + contents: write + issues: write + pull-requests: write + id-token: write + jobs: release-please: runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} steps: - - uses: GoogleCloudPlatform/release-please-action@v5 + - uses: googleapis/release-please-action@v4 id: release with: - token: ${{ secrets.GITHUB_TOKEN }} release-type: node - package-name: npcheck + publish: + runs-on: ubuntu-latest + needs: release-please + if: needs.release-please.outputs.release_created == 'true' + + steps: - uses: actions/checkout@v6 - if: ${{ steps.release.outputs.release_created }} - uses: actions/setup-node@v6 with: - node-version: 16 - registry-url: 'https://registry.npmjs.org' - if: ${{ steps.release.outputs.release_created }} + node-version: 22 + registry-url: "https://registry.npmjs.org" + package-manager-cache: false - run: npm ci - if: ${{ steps.release.outputs.release_created }} - run: npm test - if: ${{ steps.release.outputs.release_created }} - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPCHECK_PUBLISH}} - if: ${{ steps.release.outputs.release_created }} diff --git a/README.md b/README.md index 4d2be00..540e97d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ## Prerequisites -- Node.js - version 20.x or greater +- Node.js - version 22.x or greater ## Install diff --git a/package-lock.json b/package-lock.json index b5647a3..53bb5c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,7 +40,7 @@ "standard-version": "^9.3.2" }, "engines": { - "node": ">=20" + "node": ">=22" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index 2c4e375..ae60043 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "npcheck": "index.js" }, "engines": { - "node": ">=20" + "node": ">=22" }, "type": "commonjs", "scripts": {