From 61a11e572e0c0f12a0947406db5f27c85631aad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Sat, 21 Oct 2023 19:23:31 +0200 Subject: [PATCH] update github action Former-commit-id: 07e7fbc088c022bcc50c980b4d3991047d4df91c [formerly ec7082255468fa1b1d82c2d3ff89bb6de4f1be6e] [formerly 5e8e1be99044258f1094c322d2f50a650c710871 [formerly 6deaf6bc3844e9dabfe1720d8f9b938f5ac66dc6]] Former-commit-id: 4b6ca604ef39ebdbc08a250340dfb74936a67475 [formerly abe2900f9c7cc1f824b40d7946cc48b7a45fcf45] Former-commit-id: 100b7756ab5d6f8643c2325630c270df913888a7 Former-commit-id: 057566661d93bf057fc3394769c448a50a7032ed Former-commit-id: e02be0e6686cf8bb53a9c90e478d86ca3a112ac4 Former-commit-id: 536b757944aa4822b9a27c6c0b2217ea6898fd27 [formerly d8d16b29ee0064e616bb8c4ca6d7b1163c47b74c] Former-commit-id: 4beceb0f93b5104ac0dadc1ff8746c097591b9a2 --- .github/workflows/release.yaml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8c95ba3..6d8b551 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -110,10 +110,30 @@ jobs: - name: Checkout Git repo uses: actions/checkout@v3 - # Download all artifacts - - uses: actions/download-artifact@v3 + # Download all artifacts in zip format + # https://github.com/actions/download-artifact/issues/143 + - name: Download artifacts + uses: actions/github-script@v6 with: - path: artifacts + script: | + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: context.payload.workflow_run.id, + }); + for (const artifact of allArtifacts.data.artifacts) + { + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: 'zip', + }); + + let fs = require('fs'); + fs.mkdirSync('artifacts'); + fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/artifacts/${artifact.name}.zip`, Buffer.from(download.data)); + } - name: list artifacts run: find artifacts/ @@ -123,4 +143,4 @@ jobs: repo_token: "${{ secrets.RELEASE_TOKEN }}" prerelease: true files: | - artifacts/wstunnel-*/wstunnel + artifacts/*