on: workflow_run: workflows: [build] types: - completed jobs: release: name: Release # We run the release job only if a tag starts with 'v' letter if: startsWith( github.ref, 'refs/tags/v' ) runs-on: ubuntu-22.04 steps: - name: Checkout Git repo uses: actions/checkout@v3 # Download all artifacts in zip format # https://github.com/actions/download-artifact/issues/143 - name: Download artifacts uses: actions/github-script@v6 with: 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/ - uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.RELEASE_TOKEN }}" prerelease: true files: | artifacts/*