From 2684cedddf92a08bbff1c81a2aff97c9fac01661 Mon Sep 17 00:00:00 2001 From: Eng Zer Jun Date: Mon, 9 Dec 2024 19:29:25 +0800 Subject: [PATCH] chore(release-pr): update `upload-artifact` action to v4 (#9859) * chore(release-pr): update `upload-artifact` and `download-artifact` actions to v4 v3 of `actions/upload-artifact` and `actions/download-artifact` will be fully deprecated by 5 December 2024. Jobs that are scheduled to run during the brownout periods will also fail. See [1][2]. [1]: https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/ [2]: https://github.blog/changelog/2024-11-05-notice-of-breaking-changes-for-github-actions/ Signed-off-by: Eng Zer Jun * Unique artifact name Reference: https://github.com/nocodb/nocodb/pull/9859#pullrequestreview-2488379782 Signed-off-by: Eng Zer Jun --------- Signed-off-by: Eng Zer Jun --- .github/workflows/release-pr.yml | 13 ++++++------ .github/workflows/uffizzi-preview.yml | 29 ++++++--------------------- 2 files changed, 13 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 973574ce5d..59702bc50d 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -107,9 +107,9 @@ jobs: envsubst < .github/uffizzi/docker-compose.uffizzi.yml > docker-compose.rendered.yml cat docker-compose.rendered.yml - name: Upload Rendered Compose File as Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: preview-spec + name: preview-spec-docker-compose path: docker-compose.rendered.yml retention-days: 2 - name: Serialize PR Event to File @@ -118,9 +118,9 @@ jobs: ${{ toJSON(github.event) }} EOF - name: Upload PR Event as Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: preview-spec + name: preview-spec-event path: event.json retention-days: 2 @@ -174,8 +174,9 @@ jobs: EOF - name: Upload PR Event as Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: preview-spec + name: preview-spec-event path: event.json retention-days: 2 + overwrite: true diff --git a/.github/workflows/uffizzi-preview.yml b/.github/workflows/uffizzi-preview.yml index 437d42cc73..ce5c73a4e1 100644 --- a/.github/workflows/uffizzi-preview.yml +++ b/.github/workflows/uffizzi-preview.yml @@ -20,31 +20,14 @@ jobs: steps: - name: 'Download artifacts' # Fetch output (zip archive) from the workflow run that triggered this workflow. - uses: actions/github-script@v6 + uses: actions/download-artifact@v4 with: - script: | - let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { - return artifact.name == "preview-spec" - })[0]; - if (matchArtifact === undefined) { - throw TypeError('Build Artifact not found!'); - } - let download = await github.rest.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - let fs = require('fs'); - fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); + path: preview-spec + pattern: preview-spec-* + merge-multiple: true - name: 'Accept event from first stage' - run: unzip preview-spec.zip event.json + run: cp preview-spec/event.json . - name: Read Event into ENV id: event @@ -58,7 +41,7 @@ jobs: # If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. if: ${{ steps.event.outputs.ACTION != 'closed' }} run: | - unzip preview-spec.zip docker-compose.rendered.yml + cp preview-spec/docker-compose.rendered.yml . echo "COMPOSE_FILE_HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_OUTPUT - name: Cache Rendered Compose File