-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (50 loc) · 2.04 KB
/
build-release-binaries.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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 }}.
tag_name: spect-apps-${{ env.RELEASE_TAG }}
files: |
${{ github.workspace }}/releases/spect_compiler_linux_${{matrix.architecture}}_${{ env.RELEASE_TAG }}
${{ github.workspace }}/releases/spect_iss_linux_${{ matrix.architecture }}_${{ env.RELEASE_TAG }}