From 7dabed5caa4269179aeb3448cf5d2c4cdacaf8ec Mon Sep 17 00:00:00 2001 From: Ajesh Sen Thapa Date: Sun, 19 May 2024 12:20:30 +0545 Subject: [PATCH] ci: updated release-please and other actions versions for node 20 --- .github/workflows/ci.yml | 6 ++-- .../{release.yml => release-please.yml} | 23 +++++------- .github/workflows/release-pr.yml | 35 ------------------- .prettierignore | 1 + .release-please-manifest.json | 1 + release-please-config.json | 10 ++++++ 6 files changed, 24 insertions(+), 52 deletions(-) rename .github/workflows/{release.yml => release-please.yml} (64%) delete mode 100644 .github/workflows/release-pr.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a31dcc..87e5ac0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,10 +18,10 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' @@ -39,7 +39,7 @@ jobs: run: npm run coverage - name: Send coverage reports to CodeCov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: false diff --git a/.github/workflows/release.yml b/.github/workflows/release-please.yml similarity index 64% rename from .github/workflows/release.yml rename to .github/workflows/release-please.yml index ab602b1..ade43de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-please.yml @@ -1,37 +1,32 @@ -# Creates a Github release and NPM publish after the merge of -# release PR created by release-pr.yml -name: 'Release' +name: 'Release Please' on: push: branches: - main -permissions: {} +permissions: + contents: write + pull-requests: write + jobs: release-please: - permissions: - contents: write # to create release commit (google-github-actions/release-please-action) - pull-requests: write # to create release PR (google-github-actions/release-please-action) - runs-on: ubuntu-latest steps: - - uses: google-github-actions/release-please-action@v3 + - uses: googleapis/release-please-action@v4 id: release with: + # NOTE: GITHUB_TOKEN doesn't run checks on Release PR token: ${{ secrets.GITHUB_TOKEN }} - command: github-release - release-type: node - package-name: nepali-datetime # The logic below handles the npm publication: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # these if statements ensure that a publication only occurs when # a new release is created: if: ${{ steps.release.outputs.release_created }} - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml deleted file mode 100644 index cd21e32..0000000 --- a/.github/workflows/release-pr.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow is to create a release PR for a specified version. -# It can be trigger manually with the version as an input. -# Once the PR is merged into main branch the release.yml workflow -# will start the release process. -name: 'Release PR' - -on: - workflow_dispatch: - -permissions: {} -jobs: - release-please: - permissions: - contents: write # to create release commit (google-github-actions/release-please-action) - pull-requests: write # to create release PR (google-github-actions/release-please-action) - - runs-on: ubuntu-latest - steps: - - name: Display Release version - run: echo "Creating release PR" - - - name: Create Release PR - uses: google-github-actions/release-please-action@v3 - id: release - with: - token: ${{ secrets.REPO_SCOPED_TOKEN }} - release-type: node - package-name: nepali-datetime - pull-request-title-pattern: 'chore: release v${version}' - pull-request-header: 'Release PR' - changelog-types: > - [ - {"type":"fix","section":"Bug Fixes"}, - {"type":"feat","section":"Features"} - ] diff --git a/.prettierignore b/.prettierignore index eae16af..b2f9837 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ dist/ CHANGELOG.md +.release-please-manifest.json \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..484cfe6 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{ ".": "1.0.0" } diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..54778f0 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "include-component-in-tag": false, + "packages": { + ".": {} + }, + "pull-request-header": "Release PR", + "pull-request-title-pattern": "chore: release v${version}", + "release-type": "node" +}