-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (50 loc) · 1.44 KB
/
compile.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
50
51
52
53
54
55
56
57
58
59
60
name: compile release
on:
push:
branches: [ main, devel ]
schedule:
- cron: "32 14 3,17 * *"
jobs:
# create a build matrix with the available make targets
list-targets:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.listing.outputs.targets }}
steps:
- name: checkout
uses: actions/checkout@v3
- name: list available make targets
id: listing
run: |
make list-targets \
| tr -d '\n' \
| jq -Rsc 'split(" ")' \
| sed 's:^:targets=:' >> $GITHUB_OUTPUT
# compile binaries for available targets listed above
build:
runs-on: ubuntu-latest
needs: list-targets
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.list-targets.outputs.targets) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Compile static binaries for target
run: |
make clean
make ${{ matrix.target }} || \
(echo "=== RETRY 1 ==="; make ${{ matrix.target }} ) || \
(echo "=== RETRY 2 ==="; make ${{ matrix.target }} )
rm -f compiled/native
make sources/${{ matrix.target }}.tar
- name: Upload job artifact
uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/main'
with:
name: ${{ matrix.target }}
path: |
compiled/*
sources/*
retention-days: 60