[ci] Attempt to fix release workflow #85
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release (Test) | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
devel-release: | |
name: Development | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.10.0 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- 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, | |
}); | |
let fs = require('fs'); | |
for (const artifact of allArtifacts) { | |
let download = await github.rest.actions.downloadArtifact({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
artifact_id: artifact.id, | |
archive_format: 'zip', | |
}); | |
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/`+artifact.name+`.zip`, Buffer.from(download.data)); | |
} | |
- name: Unzip files | |
shell: bash | |
run: | | |
mkdir archives | |
unzip 'release_*.zip' -d archives | |
cd archives | |
for f in *; do mv "$f" "${f/release_/}";done | |
- name: Prepare Release | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git tag devel | |
git push -f origin tag devel | |
- name: Release | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NOTES: | | |
Latest development release, ready to install. | |
This release tag is continuously updated. | |
run: | | |
gh release delete devel -y || true | |
gh release create devel ./archives/* --title "Latest Development Release" --notes "${{ env.NOTES }}" --prerelease --target ${{ github.sha }} |