diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 15eac82..3bcaf3a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -15,7 +15,7 @@ jobs: uses: artusjs/github-actions/.github/workflows/node-test.yml@v1 with: os: 'ubuntu-latest, macos-latest, windows-latest' - version: '16, 18' + version: '16, 18, 20, 22' # Node.js 14 has no macOS arm64 build (macos-latest is Apple Silicon), # so run it on Linux and Windows only. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 953f3f7..637b892 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,16 +27,20 @@ jobs: release: name: Release runs-on: ubuntu-latest + # 避免并发触发的两次发布互相踩踏,且不取消进行中的发布 + concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 24 registry-url: 'https://registry.npmjs.org' # OIDC trusted publishing requires npm >= 11.5.1 @@ -56,6 +60,7 @@ jobs: - name: Version bump id: bump + if: ${{ github.event.inputs.dry_run != 'true' }} run: | npm version ${{ github.event.inputs.version_type }} -m "Release v%s" echo "tag=v$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT" @@ -72,7 +77,7 @@ jobs: - name: Push commit and tag if: ${{ github.event.inputs.dry_run != 'true' }} - run: git push origin HEAD --follow-tags + run: git push origin HEAD:${{ github.ref_name }} --follow-tags - name: Create GitHub Release if: ${{ github.event.inputs.dry_run != 'true' }}