Build and release SPECT binaries #31
This file contains 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 and release SPECT binaries | |
on: | |
workflow_run: | |
workflows: ['call-submodule-corrector'] | |
branches: ['master'] | |
types: | |
- completed | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: spect-env | |
jobs: | |
build: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
name: Build and release binaries | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
architecture: [amd64, arm64v7] | |
fail-fast: false | |
steps: | |
- name: Checkout current repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Get file name | |
id: get-tag | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Build binaries | |
env: | |
RELEASE_TAG: ${{ steps.get-tag.outputs.tag }} | |
run: | | |
docker build -t ${{ env.IMAGE_NAME }}-linux-${{ matrix.architecture }}:latest -f Dockerfiles/Dockerfile . | |
docker run --rm -v $(pwd):/app -w /app ${{ env.IMAGE_NAME }}-linux-${{ matrix.architecture }}:latest ./build.sh --clean | |
mkdir ${{ github.workspace }}/releases | |
cp build/src/apps/spect_compiler ${{ github.workspace }}/releases/spect_compiler_linux_${{ matrix.architecture }}_${{ env.RELEASE_TAG }} | |
cp build/src/apps/spect_iss ${{ github.workspace }}/releases/spect_iss_linux_${{ matrix.architecture }}_${{ env.RELEASE_TAG }} | |
- name: Create release | |
env: | |
RELEASE_TAG: ${{ steps.get-tag.outputs.tag }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
body: | | |
SPECT compiler and ISS binaries built from commit ${{ github.sha }}. | |
files: | | |
${{ github.workspace }}/releases/spect_compiler_linux_${{matrix.architecture}}_${{ env.RELEASE_TAG }} | |
${{ github.workspace }}/releases/spect_iss_linux_${{ matrix.architecture }}_${{ env.RELEASE_TAG }} |