This repository was archived by the owner on Sep 12, 2024. It is now read-only.
Build Binaries #225
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: 'Build Binaries' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 5 * * 0' | |
permissions: | |
contents: read | |
pull-requests: read | |
# This allows a subsequently queued workflow run to interrupt previous runs | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
build-binaries: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
targets: [ linux ] | |
architectures: [ x86_64, aarch64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache Binaries | |
id: cache-binaries | |
uses: actions/cache@v3 | |
with: | |
path: ./build | |
key: cached-binaries-${{ github.run_id }} | |
- name: Execute the script | |
env: | |
TARGET_BUILD: ${{ matrix.targets }} | |
ARCH_BUILD: ${{ matrix.architectures }} | |
run: | | |
bash ./scripts/build-binaries.sh | |
- name: Archive built artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cached-binaries-${{ github.run_id }} | |
path: ./build | |
show-binaries: | |
needs: | |
- build-binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download archived built artifacts | |
id: download-artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: cached-binaries-${{ github.run_id }} | |
- name: List binaries | |
run: | | |
ls ${{steps.download-artifacts.outputs.download-path}} | |
create-release-draft: | |
needs: | |
- show-binaries | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download built artifacts | |
id: download-artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: cached-binaries-${{ github.run_id }} | |
path: release | |
- name: Create release draft | |
id: draft-release | |
uses: release-drafter/release-drafter@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload binaries to release | |
shell: bash | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_UPLOAD_URL: ${{steps.draft-release.outputs.upload_url}} | |
ARTIFACTS_LOCAL_PATH: ${{steps.download-artifacts.outputs.download-path}} | |
run: | | |
bash ./scripts/upload-release-assets.sh |