-
Notifications
You must be signed in to change notification settings - Fork 0
244 lines (194 loc) · 7.5 KB
/
Copy pathrelease.yml
File metadata and controls
244 lines (194 loc) · 7.5 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
name: Build, Test and Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-linux-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build Textfetch Binary
run: make
- name: Test Execution
run: ./bin/textfetch -v
- name: Profile Execution Time
run: \time -v bin/textfetch
- name: Check for Memory Leaks
run: |
make leaks
./bin/textfetch-leaks
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: textfetch-linux-amd64
path: bin/textfetch
build-linux-arm64:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- name: Build Textfetch Binary
run: make
- name: Test Execution
run: ./bin/textfetch -v
- name: Profile Execution Time
run: \time -v bin/textfetch
- name: Check for Memory Leaks
run: |
make leaks
./bin/textfetch-leaks
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: textfetch-linux-arm64
path: bin/textfetch
build-linux-luckfox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download SDK
uses: actions/checkout@v6
with:
repository: LuckfoxTECH/luckfox-pico
path: SDKs
sparse-checkout: |
tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf
sparse-checkout-cone-mode: false
- name: Build Textfetch Binary
run: |
export TOOLCHAIN=$GITHUB_WORKSPACE/SDKs/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin
make CC=$TOOLCHAIN/arm-rockchip830-linux-uclibcgnueabihf-gcc
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: textfetch-linux-luckfox
path: bin/textfetch
build-macos-intel:
runs-on: macos-15-intel
steps:
- uses: actions/checkout@v6
- name: Download SDK
run: |
mkdir -p $GITHUB_WORKSPACE/SDKs
curl -fsSL https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.11.sdk.tar.xz \
| tar -xJ -C $GITHUB_WORKSPACE/SDKs
- name: Build Textfetch Binary
run: |
SDKROOT=$GITHUB_WORKSPACE/SDKs/MacOSX10.11.sdk
make CFLAGS="-target x86_64-apple-macos10.7 -isysroot $SDKROOT" \
LDFLAGS="-target x86_64-apple-macos10.7 -isysroot $SDKROOT -Wl,-ld_classic -Wl,-no_new_main" \
TARGET="bin/textfetch-legacy"
rm -rf obj
make CFLAGS="-target x86_64-apple-macos10.9 -isysroot $SDKROOT" \
LDFLAGS="-target x86_64-apple-macos10.9 -isysroot $SDKROOT" \
TARGET="bin/textfetch-modern"
- name: Test Execution
run: |
./bin/textfetch-legacy -v
./bin/textfetch-modern -v
- name: Profile Execution Time
run: |
/usr/bin/time -l bin/textfetch-legacy
/usr/bin/time -l bin/textfetch-modern
- name: Check for Memory Leaks
run: |
SDKROOT=$GITHUB_WORKSPACE/SDKs/MacOSX10.11.sdk
make leaks \
CFLAGS="-target x86_64-apple-macos10.7 -isysroot $SDKROOT" \
LDFLAGS="-target x86_64-apple-macos10.7 -isysroot $SDKROOT -Wl,-ld_classic -Wl,-no_new_main" \
TARGET_LEAKS="bin/textfetch-legacy-leaks"
rm -rf obj
make leaks \
CFLAGS="-target x86_64-apple-macos10.9 -isysroot $SDKROOT" \
LDFLAGS="-target x86_64-apple-macos10.9 -isysroot $SDKROOT" \
TARGET_LEAKS="bin/textfetch-modern-leaks"
./bin/textfetch-legacy-leaks
./bin/textfetch-modern-leaks
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: textfetch-macos-intel
path: bin/textfetch-*
build-macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- name: Build Textfetch Binary
run: |
make CFLAGS="-target arm64-apple-macos11" \
LDFLAGS="-target arm64-apple-macos11"
- name: Test Execution
run: ./bin/textfetch -v
- name: Check for Memory Leaks
run: |
make leaks
./bin/textfetch-leaks
- name: Profile Execution Time
run: /usr/bin/time -l bin/textfetch
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: textfetch-macos-arm64
path: bin/textfetch
build-android-termux:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- name: Build Textfetch Binary in Termux
run: |
docker run --name termux-build --security-opt seccomp:unconfined \
-v ${{ github.workspace }}:/src:ro \
termux/termux-docker:aarch64 \
bash -c "export DEBIAN_FRONTEND=noninteractive && \
apt update -yq && \
apt upgrade -yq -o Dpkg::Options::='--force-confnew' && \
apt install -yq clang make mesa mesa-dev && \
cp -r /src /tmp/build && \
cd /tmp/build && \
make"
mkdir -p ${{ github.workspace }}/bin
docker cp termux-build:/tmp/build/bin/textfetch ${{ github.workspace }}/bin/textfetch
docker rm termux-build
- name: Upload Artifact
uses: actions/upload-artifact@v6
with:
name: textfetch-android-termux-arm64
path: bin/textfetch
release:
needs: [build-linux-amd64, build-linux-arm64, build-linux-luckfox, build-macos-intel, build-macos-arm64, build-android-termux]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
- name: Prepare Archives
run: |
mkdir release_dist
# 1. Linux AMD64
tar -C artifacts/textfetch-linux-amd64 -czvf release_dist/textfetch-linux-amd64.tar.gz textfetch
# 2. Linux ARM64
tar -C artifacts/textfetch-linux-arm64 -czvf release_dist/textfetch-linux-arm64.tar.gz textfetch
# 3. Linux Luckfox
tar -C artifacts/textfetch-linux-luckfox -czvf release_dist/textfetch-linux-luckfox.tar.gz textfetch
# 4. macOS ARM64 (Apple Silicon)
tar -C artifacts/textfetch-macos-arm64 -czvf release_dist/textfetch-macos-arm64.tar.gz textfetch
# 5. macOS Intel - Legacy (10.7+)
mkdir -p temp_intel_legacy
cp artifacts/textfetch-macos-intel/textfetch-legacy temp_intel_legacy/textfetch
tar -C temp_intel_legacy -czvf release_dist/textfetch-macos-intel-legacy.tar.gz textfetch
# 6. macOS Intel - Modern (10.9+)
mkdir -p temp_intel_modern
cp artifacts/textfetch-macos-intel/textfetch-modern temp_intel_modern/textfetch
tar -C temp_intel_modern -czvf release_dist/textfetch-macos-intel-modern.tar.gz textfetch
# 7. Android Termux (ARM64)
tar -C artifacts/textfetch-android-termux-arm64 -czvf release_dist/textfetch-android-termux-arm64.tar.gz textfetch
- name: Create Release
uses: softprops/action-gh-release@v2.6.1
with:
files: release_dist/*.tar.gz
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}