From 3a2be2736451e2dfed24875a92d72cf55073c3c1 Mon Sep 17 00:00:00 2001 From: Eason Su Date: Mon, 22 Apr 2024 14:51:52 +0800 Subject: [PATCH] Upgrade the workflows of the `github-actions` package to use Node.js v20. --- .github/workflows/github-actions-create-release.yml | 6 +++--- .github/workflows/github-actions-create-test-build.yml | 4 ++-- .github/workflows/github-actions-delete-test-build.yml | 2 +- .github/workflows/github-actions-prepare-release.yml | 10 +++++----- .github/workflows/github-actions-release.yml | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/github-actions-create-release.yml b/.github/workflows/github-actions-create-release.yml index 17f6c44a..bafd12f3 100644 --- a/.github/workflows/github-actions-create-release.yml +++ b/.github/workflows/github-actions-create-release.yml @@ -12,10 +12,10 @@ jobs: if: ${{ github.event.pull_request.head.ref == 'release/actions' && github.event.review.state == 'approved' }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create release - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const workspace = '${{ github.workspace }}'; @@ -27,7 +27,7 @@ jobs: } ); - name: Upload release artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: release path: /tmp/release.json diff --git a/.github/workflows/github-actions-create-test-build.yml b/.github/workflows/github-actions-create-test-build.yml index 8cc7b1f6..5794ce81 100644 --- a/.github/workflows/github-actions-create-test-build.yml +++ b/.github/workflows/github-actions-create-test-build.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare node uses: ./packages/github-actions/actions/prepare-node with: - node-version: 14 + node-version: 20 cache-dependency-path: ./packages/github-actions/package-lock.json install-deps: "no" diff --git a/.github/workflows/github-actions-delete-test-build.yml b/.github/workflows/github-actions-delete-test-build.yml index 44af5dfd..262fac5a 100644 --- a/.github/workflows/github-actions-delete-test-build.yml +++ b/.github/workflows/github-actions-delete-test-build.yml @@ -10,7 +10,7 @@ jobs: if: github.event.ref_type == 'branch' steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: trunk diff --git a/.github/workflows/github-actions-prepare-release.yml b/.github/workflows/github-actions-prepare-release.yml index 9cb45026..871d7350 100644 --- a/.github/workflows/github-actions-prepare-release.yml +++ b/.github/workflows/github-actions-prepare-release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check created release branch - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | if ( ! context.payload.created ) { @@ -27,12 +27,12 @@ jobs: needs: CheckCreatedBranch steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Prepare node uses: ./packages/github-actions/actions/prepare-node with: - node-version: 14 + node-version: 20 cache-dependency-path: ./packages/github-actions/package-lock.json install-deps: "no" @@ -72,7 +72,7 @@ jobs: jq ".version=\"${NEXT_VER}\"" package.json > package.json.tmp mv package.json.tmp package.json - jq ".version=\"${NEXT_VER}\"" package-lock.json > package-lock.json.tmp + jq ".version=\"${NEXT_VER}\" | .packages.\"\".version=\"${NEXT_VER}\"" package-lock.json > package-lock.json.tmp mv package-lock.json.tmp package-lock.json git config user.name github-actions[bot] @@ -85,7 +85,7 @@ jobs: git push - name: Create a pull request for release - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const workspace = '${{ github.workspace }}'; diff --git a/.github/workflows/github-actions-release.yml b/.github/workflows/github-actions-release.yml index f0224e10..48a8ae9a 100644 --- a/.github/workflows/github-actions-release.yml +++ b/.github/workflows/github-actions-release.yml @@ -22,7 +22,7 @@ jobs: release: ${{ steps.set-result.outputs.release }} steps: - name: Check tag name or workflow_run conclusion - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const { payload, eventName } = context; @@ -40,7 +40,7 @@ jobs: - name: Get release artifact id: set-result if: ${{ github.event.workflow_run.conclusion == 'success' }} - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const fs = require( 'fs' ); @@ -77,14 +77,14 @@ jobs: echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ steps.resolve-tag.outputs.tag_name }} - name: Prepare node uses: ./packages/github-actions/actions/prepare-node with: - node-version: 14 + node-version: 20 cache-dependency-path: ./packages/github-actions/package-lock.json install-deps: "no"