-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (117 loc) · 3.81 KB
/
build.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Build
on:
push:
branches:
- '**'
jobs:
native-build:
name: 'Native build'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
submodules: true
- name: Check for cache
id: check-cache
uses: actions/cache@main
with:
key: gcc-14.1.0-1
lookup-only: true
path: |
/tmp/x86_64-linux-gnu.tar.xz
/tmp/x86_64-linux-gnu.tar.xz.sha256
- name: Build Atar
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }}
run: |
bash './build.sh' 'native'
- name: Generate tarball
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }}
run: |
declare tarball_filename='/tmp/x86_64-linux-gnu.tar.xz'
tar --directory='/tmp' --create --file=- 'atar' | xz --threads='0' --compress -9 > "${tarball_filename}"
sha256sum "${tarball_filename}" | sed 's|/tmp/||' > "${tarball_filename}.sha256"
- name: Upload artifact
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }}
uses: actions/upload-artifact@main
with:
name: native-toolchain
if-no-files-found: error
path: |
/tmp/x86_64-linux-gnu.tar.xz
/tmp/x86_64-linux-gnu.tar.xz.sha256
- name: Cache artifact
if: ${{ steps.check-cache.outputs.cache-hit != 'true' }}
uses: actions/cache@main
with:
key: gcc-14.1.0-1
path: |
/tmp/x86_64-linux-gnu.tar.xz
/tmp/x86_64-linux-gnu.tar.xz.sha256
cross-build:
name: 'Cross build'
needs: native-build
runs-on: ubuntu-latest
strategy:
matrix:
target: [
'alpha-unknown-linux-gnu',
'x86_64-unknown-linux-gnu',
'i386-unknown-linux-gnu',
'arm-unknown-linux-gnueabi',
'arm-unknown-linux-gnueabihf',
'hppa-unknown-linux-gnu',
'aarch64-unknown-linux-gnu',
'mips-unknown-linux-gnu',
'mipsel-unknown-linux-gnu',
'powerpc-unknown-linux-gnu',
's390-unknown-linux-gnu',
's390x-unknown-linux-gnu',
'sparc-unknown-linux-gnu',
'powerpc64le-unknown-linux-gnu'
]
steps:
- uses: actions/checkout@main
with:
submodules: true
- name: Restore from cache
uses: actions/cache@main
with:
key: gcc-14.1.0-1
fail-on-cache-miss: true
path: |
/tmp/x86_64-linux-gnu.tar.xz
/tmp/x86_64-linux-gnu.tar.xz.sha256
- name: Setup toolchain
run: |
tar --directory='/tmp' --extract --file='/tmp/x86_64-linux-gnu.tar.xz'
mv '/tmp/atar' '/tmp/atar-toolchain'
- name: Install Clang 18
run: |
wget 'https://apt.llvm.org/llvm.sh'
sudo bash './llvm.sh' '18'
for old in '/usr/bin/'*'-18'; do
declare new="$(sed 's/-18//g' <<< "${old}")"
[ -f "${new}" ] && sudo unlink "${new}"
sudo ln --symbolic "${old}" "${new}"
done
- name: Build Atar with OBGGCC
continue-on-error: true
run: |
source './tools/setup_toolchain.sh'
source './submodules/obggcc/tools/setup_toolchain.sh'
bash './build.sh' '${{ matrix.target }}'
- name: Generate tarball
continue-on-error: true
run: |
declare tarball_filename='/tmp/${{ matrix.target }}.tar.xz'
tar --directory='/tmp' --create --file=- 'atar' | xz --threads='0' --compress -9 > "${tarball_filename}"
sha256sum "${tarball_filename}" | sed 's|/tmp/||' > "${tarball_filename}.sha256"
- name: Upload artifact
continue-on-error: true
uses: actions/upload-artifact@main
with:
name: ${{ matrix.target }}
if-no-files-found: error
path: |
/tmp/${{ matrix.target }}.tar.xz
/tmp/${{ matrix.target }}.tar.xz.sha256