-
-
Notifications
You must be signed in to change notification settings - Fork 2
150 lines (127 loc) · 4.13 KB
/
Copy pathcreate_qmk_toolchains.yaml
File metadata and controls
150 lines (127 loc) · 4.13 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
name: 2. (tzarc) Create QMK Toolchains
on:
workflow_dispatch:
schedule:
- cron: "37 11 */6 * *" # every 6 days to ensure we still work
permissions:
contents: write
packages: write
env:
TC_WORKDIR: "/t"
EXECUTE_UNDER_DOCKER: true
jobs:
tarballs:
# only actually execute on @tzarc's repo so as to not lock up QMK org's resources
if: github.repository == 'tzarc/qmk_toolchains'
name: Download required tarballs
uses: ./.github/workflows/download_tarballs.yaml
with:
state_name: create_qmk_toolchains
container_name: ghcr.io/tzarc/qmk_toolchains:builder
create-toolchains:
name: Toolchain
needs: [tarballs]
strategy:
fail-fast: false
matrix:
build_host: [linuxX64, linuxARM64, linuxRV64, windowsX64, macosX64, macosARM64]
target_host: [baremetalARM, baremetalAVR, baremetalRV32]
uses: ./.github/workflows/create_one_toolchain.yaml
with:
crosstool_host_os: linuxX64
build_host: ${{ matrix.build_host }}
target_host: ${{ matrix.target_host }}
build_script: host_${{ matrix.build_host }}-target_${{ matrix.target_host }}.sh
fetch_bootstrap: false
strip-and-repack-toolchains:
name: Strip and repack toolchains
needs: [create-toolchains]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target_host: [baremetalARM, baremetalAVR, baremetalRV32]
steps:
- name: Maximize build space
uses: tzarc/maximize-build-space@btrfs-mods
with:
btrfs-compression: "true"
build-mount-path: /b
root-reserve-mb: 2048
swap-size-mb: 8192
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
remove-docker-images: "true"
- name: Install prereqs
run: |
set -x
sudo apt-get update
sudo apt-get install -y zstd
- name: Clone toolchains repo
uses: actions/checkout@v7
- name: Download toolchains
uses: actions/download-artifact@v8
with:
pattern: toolchain-*-target_${{ matrix.target_host }}
path: .
merge-multiple: true
- name: Unpack toolchains
run: |
set -x
mkdir toolchains
for file in $(ls qmk_toolchain*.tar.*); do
echo "Extracting $file"
tar axf $file -C toolchains
done
- name: Strip toolchains
run: |
set -x
for dir in $(ls -d toolchains/*${{ matrix.target_host }}); do
echo "Stripping toolchain in $dir"
./strip_toolchain.sh $dir
done
- name: Repack toolchains
run: |
set -x
for dir in $(ls -d toolchains/*${{ matrix.target_host }}); do
output_filename=$(ls qmk_toolchain*.tar.zst | grep $(basename $dir))
echo "Repacking toolchain in $dir => $output_filename"
[[ ! -f $output_filename ]] || rm -f $output_filename
tar cf $(basename ${output_filename} .zst) --sort=name -C toolchains $(basename $dir)
zstdmt -T0 -19 --long --rm --force $(basename ${output_filename} .zst)
done
- name: Upload toolchain
uses: actions/upload-artifact@v7
with:
name: stripped-toolchains-target_${{ matrix.target_host }}
path: |
qmk_toolchain-gcc*.tar.zst
publish:
name: Publish toolchains
needs: [strip-and-repack-toolchains]
runs-on: ubuntu-latest
steps:
- name: Clone toolchains repo
uses: actions/checkout@v7
- name: Download toolchains
uses: actions/download-artifact@v8
with:
pattern: stripped-toolchains-*
path: .
merge-multiple: true
- name: Dump list
run: |
ls -1al *.tar.zst
- name: Delete tag
run: gh release delete latest --cleanup-tag || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v3
with:
files: |
qmk_toolchain*
tag_name: latest