ci(release): scope cargo apk build to --lib to avoid post-sign panic
Release / Build · Android APK (push) Has been cancelled
Release / Publish GitHub Release (push) Has been cancelled
Release / Build · Linux x86_64 (push) Has been cancelled

cargo-apk panics with "Bin is not compatible with Cdylib" after
successfully signing the APK, when cargo-subcommand's artifact
iterator walks the bin target after the cdylib has been produced.
The APK file survives the panic on disk, but the non-zero exit
fails the workflow step before the upload runs.

Passing --lib scopes the build to the cdylib target only.
SESSION_HANDOFF.md documented this as the canonical workaround.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-10 19:18:46 -07:00
parent 6a289b7b50
commit a5c3188686
+7 -1
View File
@@ -126,7 +126,13 @@ jobs:
} >> solitaire_app/Cargo.toml
- name: Build and sign APK (release profile)
run: cargo apk build -p solitaire_app --release
# `--lib` scopes cargo-apk to the cdylib target only.
# Without it, cargo-apk panics post-sign with
# "Bin is not compatible with Cdylib" (cargo-subcommand
# artifact iteration walks the bin target after the
# cdylib APK is already produced). See SESSION_HANDOFF.md
# "Cosmetic cargo apk build --lib workaround."
run: cargo apk build -p solitaire_app --lib --release
- name: Stage APK for upload
run: |