diff --git a/.github/settings.yml b/.github/settings.yml deleted file mode 100644 index adbef7e6..00000000 --- a/.github/settings.yml +++ /dev/null @@ -1,52 +0,0 @@ -# This file is automatically added by @npmcli/template-oss. Do not edit. - -repository: - allow_merge_commit: false - allow_rebase_merge: true - allow_squash_merge: true - squash_merge_commit_title: PR_TITLE - squash_merge_commit_message: PR_BODY - delete_branch_on_merge: true - enable_automated_security_fixes: true - enable_vulnerability_alerts: true - -branches: - - name: main - protection: - required_status_checks: null - enforce_admins: true - required_pull_request_reviews: - required_approving_review_count: 1 - require_code_owner_reviews: true - require_last_push_approval: true - dismiss_stale_reviews: true - restrictions: - apps: [] - users: [] - teams: [ "cli-team" ] - - name: latest - protection: - required_status_checks: null - enforce_admins: true - required_pull_request_reviews: - required_approving_review_count: 1 - require_code_owner_reviews: true - require_last_push_approval: true - dismiss_stale_reviews: true - restrictions: - apps: [] - users: [] - teams: [ "cli-team" ] - - name: release/v* - protection: - required_status_checks: null - enforce_admins: true - required_pull_request_reviews: - required_approving_review_count: 1 - require_code_owner_reviews: true - require_last_push_approval: true - dismiss_stale_reviews: true - restrictions: - apps: [] - users: [] - teams: [ "cli-team" ] diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 614b85d7..3cbca596 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -25,8 +25,11 @@ jobs: git config --global user.name "npm CLI robot" - name: Setup Node uses: actions/setup-node@v3 + id: node with: - node-version: 18.x + node-version: 20.x + check-latest: contains('20.x', '.x') + - name: Remove Template-OSS if: matrix && matrix.node-version == '6.17.1' run: | diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index 74b61726..cd75041e 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -8,7 +8,7 @@ on: ref: required: true type: string - default: main + default: release/v5 workflow_call: inputs: ref: @@ -80,8 +80,11 @@ jobs: git config --global user.name "npm CLI robot" - name: Setup Node uses: actions/setup-node@v3 + id: node with: - node-version: 18.x + node-version: 20.x + check-latest: contains('20.x', '.x') + - name: Remove Template-OSS if: matrix && matrix.node-version == '6.17.1' run: | @@ -115,7 +118,7 @@ jobs: shell: bash node-version: - 6.17.1 - - 18.x + - 20.x runs-on: ${{ matrix.platform.os }} defaults: run: @@ -174,8 +177,11 @@ jobs: git config --global user.name "npm CLI robot" - name: Setup Node uses: actions/setup-node@v3 + id: node with: node-version: ${{ matrix.node-version }} + check-latest: contains(matrix.node-version, '.x') + - name: Remove Template-OSS if: matrix && matrix.node-version == '6.17.1' run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11b02c0d..895a0567 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: push: branches: - main - - latest - release/v* schedule: # "At 09:00 UTC (02:00 PT) on Monday" https://crontab.guru/#0_9_*_*_1 @@ -31,8 +30,11 @@ jobs: git config --global user.name "npm CLI robot" - name: Setup Node uses: actions/setup-node@v3 + id: node with: - node-version: 18.x + node-version: 20.x + check-latest: contains('20.x', '.x') + - name: Remove Template-OSS if: matrix && matrix.node-version == '6.17.1' run: | @@ -59,7 +61,7 @@ jobs: shell: bash node-version: - 6.17.1 - - 18.x + - 20.x runs-on: ${{ matrix.platform.os }} defaults: run: @@ -73,8 +75,11 @@ jobs: git config --global user.name "npm CLI robot" - name: Setup Node uses: actions/setup-node@v3 + id: node with: node-version: ${{ matrix.node-version }} + check-latest: contains(matrix.node-version, '.x') + - name: Remove Template-OSS if: matrix && matrix.node-version == '6.17.1' run: | diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 21244879..9fb3f79a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -6,12 +6,10 @@ on: push: branches: - main - - latest - release/v* pull_request: branches: - main - - latest - release/v* schedule: # "At 10:00 UTC (03:00 PT) on Monday" https://crontab.guru/#0_10_*_*_1 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index ad7fb0de..bed51254 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -29,8 +29,11 @@ jobs: git config --global user.name "npm CLI robot" - name: Setup Node uses: actions/setup-node@v3 + id: node with: - node-version: 18.x + node-version: 20.x + check-latest: contains('20.x', '.x') + - name: Remove Template-OSS if: matrix && matrix.node-version == '6.17.1' run: | @@ -50,4 +53,4 @@ jobs: env: PR_TITLE: ${{ github.event.pull_request.title }} run: | - echo '$PR_TITLE' | npx --offline commitlint -V + echo "$PR_TITLE" | npx --offline commitlint -V diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96195497..0911e67e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,6 @@ on: push: branches: - main - - latest - release/v* permissions: @@ -44,8 +43,11 @@ jobs: git config --global user.name "npm CLI robot" - name: Setup Node uses: actions/setup-node@v3 + id: node with: - node-version: 18.x + node-version: 20.x + check-latest: contains('20.x', '.x') + - name: Remove Template-OSS if: matrix && matrix.node-version == '6.17.1' run: | @@ -160,8 +162,11 @@ jobs: git config --global user.name "npm CLI robot" - name: Setup Node uses: actions/setup-node@v3 + id: node with: - node-version: 18.x + node-version: 20.x + check-latest: contains('20.x', '.x') + - name: Remove Template-OSS if: matrix && matrix.node-version == '6.17.1' run: | @@ -177,7 +182,7 @@ jobs: RELEASE_COMMENT_ID: ${{ needs.release.outputs.comment-id }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false + npm exec --offline -- template-oss-release-manager --lockfile=false --publish=true npm run rp-pull-request --ignore-scripts --if-present - name: Commit id: commit @@ -326,37 +331,26 @@ jobs: defaults: run: shell: bash + permissions: + deployments: write + id-token: write steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ fromJSON(needs.release.outputs.release).tagName }} - name: Setup Node uses: actions/setup-node@v3 with: node-version: 18.x - - name: View in Registry + - name: Install npm@latest run: | - EXIT_CODE=0 - - function is_published { - if npm view "$@" --loglevel=error > /dev/null; then - echo 0 - else - echo 1 - fi - } - - for release in $(echo '${{ needs.release.outputs.releases }}' | jq -r '.[] | @base64'); do - name=$(echo "$release" | base64 --decode | jq -r .pkgName) - version=$(echo "$release" | base64 --decode | jq -r .version) - spec="$name@$version" - status=$(is_published "$spec") - if [[ "$status" -eq 1 ]]; then - echo "$spec ERROR" - EXIT_CODE=$status - else - echo "$spec OK" - fi - done - - exit $EXIT_CODE + npm i --prefer-online --no-fund --no-audit -g npm@latest + npm config set '//registry.npmjs.org/:_authToken'=\${PUBLISH_TOKEN} + - name: Publish + env: + PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} + run: npm publish --provenance --tag=next-5 post-release-integration: needs: [ release, release-integration ] diff --git a/package.json b/package.json index db035e97..0cf846ec 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "posttest": "npm run lint" }, "devDependencies": { - "@npmcli/template-oss": "4.17.0", + "@npmcli/template-oss": "4.19.0", "tap": "^12.7.0" }, "license": "ISC", @@ -33,6 +33,6 @@ "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", "content": "./scripts/template-oss", - "version": "4.17.0" + "version": "4.19.0" } } diff --git a/scripts/template-oss/index.js b/scripts/template-oss/index.js index 8e655e01..c15cd6d6 100644 --- a/scripts/template-oss/index.js +++ b/scripts/template-oss/index.js @@ -13,10 +13,9 @@ module.exports = { eslint: false, dependabot: false, oldNode: OLD_NODE, - ciVersions: [ - OLD_NODE, - 'latest', - ], + ciVersions: [OLD_NODE], + backport: 5, + publish: true, allowPaths: [ '/range.bnf', '/semver.js',