Skip to content

[ci] Attempt to fix release workflow #92

[ci] Attempt to fix release workflow

[ci] Attempt to fix release workflow #92

Workflow file for this run

name: Build Code
on:
pull_request:
types: [opened, synchronize, reopened]
# Cancel CI workflows which are still running from previous pushes
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
nightly-release:
name: Nightly Release
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
- name: Checkout
uses: actions/checkout@v4
- 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 matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name.startsWith("Nightly_");
});
let fs = require('fs');
for (const artifact of matchArtifacts) {
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 '*.zip' -d archives
- name: Prepare Release
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag nightly
git push -f origin tag nightly
- name: Release
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NOTES: |
Latest development release, ready to install.
This release tag is continuously updated.
run: |
output=$(gh release delete nightly -y 2>&1) || [[ "${output}" == "release not found" ]]
gh release create nightly ./archives/* --title "Nightly Release" --notes "${{ env.NOTES }}" --prerelease --target ${{ github.sha }}