Skip to content

Commit af35f35

Browse files
committed
ci(build): full pipeline with release+debug ZIPs and changelog
Restructures the CI workflow into 3 jobs: build (matrix across 2 ABIs x 2 profiles with symbol assertions), package (creates release and debug ZIPs via package.sh), and release (extracts changelog and publishes GitHub release with both ZIPs). Also adds resetprop-rs as a git submodule and updates Cargo.toml to use the relative submodule path so CI resolves the dependency.
1 parent d2a8e32 commit af35f35

4 files changed

Lines changed: 228 additions & 32 deletions

File tree

.github/workflows/build.yml

Lines changed: 218 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Module ZIP
1+
name: Build
22

33
on:
44
push:
@@ -9,60 +9,247 @@ on:
99
- 'common/**'
1010
- '*.sh'
1111
- 'module.prop'
12+
- '.github/workflows/build.yml'
1213
pull_request:
1314
branches: [main]
15+
paths:
16+
- 'rust/**'
1417
workflow_dispatch:
1518

1619
jobs:
1720
build:
1821
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
profile: [debug, release]
25+
target:
26+
- aarch64-linux-android
27+
- armv7-linux-androideabi
28+
include:
29+
- target: aarch64-linux-android
30+
abi: arm64-v8a
31+
- target: armv7-linux-androideabi
32+
abi: armeabi-v7a
1933

2034
steps:
2135
- uses: actions/checkout@v4
36+
with:
37+
submodules: recursive
2238

23-
- name: Install Rust toolchain
24-
uses: dtolnay/rust-toolchain@stable
39+
- name: Setup Android NDK
40+
uses: nttld/setup-ndk@v1
41+
id: ndk
2542
with:
26-
targets: aarch64-linux-android,armv7-linux-androideabi
43+
ndk-version: r27c
2744

28-
- name: Cache Rust dependencies
29-
uses: actions/cache@v4
45+
- uses: dtolnay/rust-toolchain@stable
46+
with:
47+
targets: ${{ matrix.target }}
48+
49+
- uses: actions/cache@v4
3050
with:
3151
path: |
3252
~/.cargo/registry
3353
~/.cargo/git
3454
rust/target
35-
key: ${{ runner.os }}-cargo-${{ hashFiles('rust/Cargo.lock') }}
36-
restore-keys: ${{ runner.os }}-cargo-
55+
key: cargo-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('rust/Cargo.lock') }}
56+
restore-keys: cargo-${{ matrix.target }}-${{ matrix.profile }}-
3757

38-
- name: Setup Android NDK
39-
uses: nttld/setup-ndk@v1
40-
id: ndk
41-
with:
42-
ndk-version: r27c
58+
- name: Build
59+
run: |
60+
NDK_BIN="${NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin"
61+
export PATH="${NDK_BIN}:${PATH}"
62+
export CC_aarch64_linux_android="${NDK_BIN}/aarch64-linux-android26-clang"
63+
export CC_armv7_linux_androideabi="${NDK_BIN}/armv7a-linux-androideabi26-clang"
64+
export AR_aarch64_linux_android="${NDK_BIN}/llvm-ar"
65+
export AR_armv7_linux_androideabi="${NDK_BIN}/llvm-ar"
4366
44-
- name: Build release and package
67+
FLAGS=""
68+
if [ "$PROFILE" = "release" ]; then
69+
FLAGS="--release"
70+
fi
71+
cd rust
72+
cargo build $FLAGS --target "$TARGET"
4573
env:
46-
ANDROID_NDK_HOME: ${{ steps.ndk.outputs.ndk-path }}
47-
run: bash package.sh --no-bump
74+
PROFILE: ${{ matrix.profile }}
75+
TARGET: ${{ matrix.target }}
76+
NDK_HOME: ${{ steps.ndk.outputs.ndk-path }}
4877

49-
- name: Upload release ZIP
50-
uses: actions/upload-artifact@v4
51-
with:
52-
name: TA_enhanced-release-${{ github.sha }}
53-
path: release/*.zip
54-
retention-days: 30
78+
- name: Assert debug info preserved
79+
if: matrix.profile == 'debug'
80+
run: |
81+
bin="rust/target/${TARGET}/debug/ta-enhanced"
82+
file "$bin"
83+
if ! readelf -S "$bin" | grep -q debug_info; then
84+
echo "::error::debug binary missing debug_info section"
85+
exit 1
86+
fi
87+
env:
88+
TARGET: ${{ matrix.target }}
5589

56-
- name: Build debug binaries
90+
- name: Assert stripped
91+
if: matrix.profile == 'release'
92+
run: |
93+
bin="rust/target/${TARGET}/release/ta-enhanced"
94+
file "$bin"
95+
if readelf -S "$bin" | grep -q debug_info; then
96+
echo "::error::release binary still contains debug_info"
97+
exit 1
98+
fi
5799
env:
58-
ANDROID_NDK_HOME: ${{ steps.ndk.outputs.ndk-path }}
59-
run: bash rust/build.sh debug
100+
TARGET: ${{ matrix.target }}
60101

61-
- name: Upload debug binaries
62-
uses: actions/upload-artifact@v4
102+
- uses: actions/upload-artifact@v4
63103
with:
64-
name: TA_enhanced-debug-${{ github.sha }}
65-
path: |
66-
bin/arm64-v8a/ta-enhanced
67-
bin/armeabi-v7a/ta-enhanced
104+
name: bin-${{ matrix.abi }}-${{ matrix.profile }}
105+
path: rust/target/${{ matrix.target }}/${{ matrix.profile }}/ta-enhanced
106+
retention-days: 7
107+
108+
package:
109+
needs: build
110+
runs-on: ubuntu-latest
111+
steps:
112+
- uses: actions/checkout@v4
113+
with:
114+
submodules: recursive
115+
116+
- name: Download build artifacts
117+
uses: actions/download-artifact@v4
118+
with:
119+
path: artifacts
120+
121+
- name: Place release binaries
122+
run: |
123+
for pair in "arm64-v8a:aarch64-linux-android" "armeabi-v7a:armv7-linux-androideabi"; do
124+
abi="${pair%%:*}"
125+
target="${pair##*:}"
126+
src="artifacts/bin-${abi}-release/ta-enhanced"
127+
dst="bin/${abi}/ta-enhanced"
128+
mkdir -p "bin/${abi}"
129+
cp "$src" "$dst"
130+
chmod +x "$dst"
131+
done
132+
133+
- name: Read version
134+
id: ver
135+
run: |
136+
ver=$(grep '^version=' module.prop | cut -d= -f2)
137+
echo "version=${ver}" >> "$GITHUB_OUTPUT"
138+
139+
- name: Package release ZIP
140+
run: bash package.sh --no-build --no-bump
141+
142+
- name: Package debug ZIP
143+
run: |
144+
MODULE_ID=$(grep '^id=' module.prop | cut -d= -f2)
145+
VER="${{ steps.ver.outputs.version }}"
146+
147+
for pair in "arm64-v8a:aarch64-linux-android" "armeabi-v7a:armv7-linux-androideabi"; do
148+
abi="${pair%%:*}"
149+
src="artifacts/bin-${abi}-debug/ta-enhanced"
150+
dst="bin/${abi}/ta-enhanced"
151+
cp "$src" "$dst"
152+
chmod +x "$dst"
153+
done
154+
155+
mkdir -p release
156+
ZIP_NAME="${MODULE_ID}-${VER}-debug.zip"
157+
zip -r9 "release/${ZIP_NAME}" . \
158+
-x ".git/*" \
159+
-x ".claude/*" \
160+
-x ".mcp-vector-search/*" \
161+
-x ".mcp.json" \
162+
-x ".gitignore" \
163+
-x "CLAUDE.md" \
164+
-x "*.zip" \
165+
-x "*.db" -x "*.db-shm" -x "*.db-wal" \
166+
-x "logs_llm/*" \
167+
-x "evidence_*.png" \
168+
-x "*.swp" -x "*~" \
169+
-x "release/*" \
170+
-x "package.sh" \
171+
-x "rust/*" \
172+
-x "node_modules/*" \
173+
-x "webui/src/*" \
174+
-x "webui/node_modules/*" \
175+
-x "*.map" \
176+
-x ".git" \
177+
-x "webui/dist/*" \
178+
-x "webui/public/*" \
179+
-x "webui/package.json" \
180+
-x "webui/package-lock.json" \
181+
-x "webui/pnpm-lock.yaml" \
182+
-x "webui/.npmrc" \
183+
-x "webui/vite.config.ts" \
184+
-x "webui/tsconfig.json" \
185+
-x "common/archive/*" \
186+
-x "bin/archive/*" \
187+
-x "webui-mockup/*" \
188+
-x "bin/*/supervisor" \
189+
-x "bin/*/keygen" \
190+
-x "config/*" \
191+
-x "glob" -x "os" \
192+
-x "*.new" \
193+
-x "vectors.db*" \
194+
-x "webui/assets/index-CExZ91Qz.js.bak" \
195+
-x "webui/material-symbols-outlined.woff2" \
196+
-x "*.md"
197+
198+
- uses: actions/upload-artifact@v4
199+
with:
200+
name: ta-enhanced-release-zip
201+
path: release/*-v*.zip
202+
retention-days: 30
203+
204+
- uses: actions/upload-artifact@v4
205+
with:
206+
name: ta-enhanced-debug-zip
207+
path: release/*-debug.zip
68208
retention-days: 30
209+
210+
release:
211+
needs: [build, package]
212+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
213+
runs-on: ubuntu-latest
214+
permissions:
215+
contents: write
216+
steps:
217+
- uses: actions/checkout@v4
218+
219+
- name: Read version
220+
id: ver
221+
run: |
222+
ver=$(grep '^version=' module.prop | cut -d= -f2)
223+
echo "version=${ver}" >> "$GITHUB_OUTPUT"
224+
225+
- uses: actions/download-artifact@v4
226+
with:
227+
name: ta-enhanced-release-zip
228+
path: zips/release
229+
230+
- uses: actions/download-artifact@v4
231+
with:
232+
name: ta-enhanced-debug-zip
233+
path: zips/debug
234+
235+
- name: Extract changelog
236+
id: notes
237+
run: |
238+
ver="${VER#v}"
239+
awk "/^## v${ver}/{flag=1; next} /^## v/{if(flag) exit} flag" CHANGELOG.md > /tmp/notes.md
240+
cat /tmp/notes.md
241+
env:
242+
VER: ${{ steps.ver.outputs.version }}
243+
244+
- name: Create release
245+
run: |
246+
gh release delete "$VER" --yes 2>/dev/null || true
247+
gh release create "$VER" \
248+
--title "$VER" \
249+
--latest \
250+
--notes-file /tmp/notes.md \
251+
zips/release/*.zip \
252+
zips/debug/*.zip
253+
env:
254+
VER: ${{ steps.ver.outputs.version }}
255+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "external/resetprop-rs"]
2+
path = external/resetprop-rs
3+
url = https://github.com/Enginex0/resetprop-rs.git

external/resetprop-rs

Submodule resetprop-rs added at 4646d28

rust/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ ring = "0.17"
2020
rcgen = { version = "0.12", default-features = false, features = ["pem", "ring"] }
2121
rsa = { version = "0.9", default-features = false, features = ["std", "pem"] }
2222
rand = "0.8"
23-
resetprop = { path = "/home/president/Git-repo-success/resetprop-rs/crates/resetprop" }
23+
resetprop = { path = "../external/resetprop-rs/crates/resetprop" }
24+
25+
[profile.dev]
26+
strip = false
27+
debug = 2
28+
opt-level = 0
2429

2530
[profile.release]
2631
lto = true

0 commit comments

Comments
 (0)