-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (47 loc) · 1.43 KB
/
build_binary.yml
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
name: Build binaries on release
on:
push:
tags:
- '*'
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
arch: [x86_64, aarch64]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v2
- name: Install dependencies (aarch64)
if: matrix.arch == 'aarch64'
run: sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Set CC / CXX (aarch64)
if: matrix.arch == 'aarch64'
run: |
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CXX=aarch64-linux-gnu-g++" >> $GITHUB_ENV
- name: Build executable
run: bash build.sh
- name: Duplicate executables (x86_64)
if: matrix.arch == 'x86_64'
run: |
cp build/submitty_count_ts build/submitty_count_ts-x86_64
cp build/submitty_diagnostics_ts build/submitty_diagnostics_ts-x86_64
- name: Move executables (aarch64)
if: matrix.arch == 'aarch64'
run: |
mv build/submitty_count_ts build/submitty_count_ts-aarch64
mv build/submitty_diagnostics_ts build/submitty_diagnostics_ts-aarch64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: executables
path: build/submitty_*
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/submitty_*