28e1fa032d
Former-commit-id: 2e02f0610e40a20f6a822920686e2093341cc1b2 [formerly 3a475d12112dbe62bec6e71d599f14a7663f72fc] [formerly 546e817db5e5a41d3c92e336e6b512a76f63dc36 [formerly 2cc4688dcb98847b08672aec11c171148eeeddb5]] Former-commit-id: 8f59a3d7432bbad7162f502203e1ed3f26b253dd [formerly c1a3c9bffc72171a01265cc2024c82b0eb2c8d24] Former-commit-id: 4b20d9c9edc001b6780fdea235a33efb69fc3954 Former-commit-id: d77b1e8d81518bd776a3c9ac8279062f75dacec6 Former-commit-id: ceaa787ed318f5403eee8367a6a820e614528d02 Former-commit-id: 0f4645cd044c3e119cbf8893564ffec8033cc034 [formerly cf641e89e044f8c568ee80fa4c47df8c0c4f9911] Former-commit-id: 193fc0fc36b0f49976e502a0c5d4b3396d8be7c5
50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
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/*
|