ci: add release workflows#959
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
14162ef to
4aa5247
Compare
4aa5247 to
13528fa
Compare
piotr-iohk
left a comment
There was a problem hiding this comment.
Not clear about the reproducible-release.yml. Also I think that /release command and process should be adjusted such that it takes into account release.yml producing release artifacts. Please see individual comments.
13528fa to
117d56e
Compare
can't signal it was addressed by re-requesting review on the "changes requested" alert.
Local test: is the now-blocking diffoscope comparison safe?Since the diffoscope compare is now blocking, I checked locally whether two honest builds with the same keystore yield byte-identical signed APKs, or whether signature non-determinism could cause false failures. This only needs to exercise the script's signing path ( Setup WORK=.ai/repro-det-test; mkdir -p "$WORK"
# any mainnetRelease bundle works; I reused the on-disk intermediate
cp app/build/intermediates/intermediary_bundle/mainnetRelease/packageMainnetReleaseBundle/intermediary-bundle.aab \
"$WORK/bitkit-mainnet-release-999.aab"
export BUNDLETOOL_JAR="$PWD/$WORK/bundletool.jar" # shared across runs
keytool -genkeypair -keystore "$WORK/rsa.keystore" -storepass test1234 -keypass test1234 \
-alias testkey -keyalg RSA -keysize 2048 -validity 30 -dname "CN=test, O=test, C=US"
keytool -genkeypair -keystore "$WORK/ec.keystore" -storepass test1234 -keypass test1234 \
-alias testkey -keyalg EC -groupname secp256r1 -validity 30 -dname "CN=test, O=test, C=US"Test A — run export SKIP_GRADLE_BUILD=true
export AAB_PATH="$PWD/$WORK/bitkit-mainnet-release-999.aab"
export KEYSTORE_FILE="$PWD/$WORK/rsa.keystore" KEYSTORE_PASSWORD=test1234 KEY_ALIAS=testkey KEY_PASSWORD=test1234
OUTPUT_DIR="$WORK/rsa-run1" scripts/reproduce-release.sh
OUTPUT_DIR="$WORK/rsa-run2" scripts/reproduce-release.sh
diff "$WORK/rsa-run1/checksums/extracted-apks.sha256" "$WORK/rsa-run2/checksums/extracted-apks.sha256"
# -> no diff: byte-identical extracted APKs across runs ✅Test B — sign the same APK twice with APKSIGNER=$ANDROID_HOME/build-tools/36.0.0/apksigner
base=$(find "$WORK/rsa-run1/extracted-apks" -name '*.apk' | head -1)
for alg in rsa ec; do
for f in a b; do
cp "$base" "$WORK/$alg-$f.apk"
"$APKSIGNER" sign --ks "$WORK/$alg.keystore" --ks-pass pass:test1234 --key-pass pass:test1234 \
--ks-key-alias testkey --v1-signing-enabled false --v2-signing-enabled true \
--v3-signing-enabled true --min-sdk-version 24 "$WORK/$alg-$f.apk"
done
echo "$alg:"; shasum -a 256 "$WORK/$alg-a.apk" "$WORK/$alg-b.apk"
doneResults
Conclusion The blocking diffoscope step is safe iff the release/internal keystores use RSA keys (RSA PKCS#1 v1.5 signatures are deterministic → two honest builds are byte-identical). This is the common case for Android signing keys. With an ECDSA key the signature block is non-deterministic and would cause false reproducibility failures. Side note: bundletool So this reduces to confirming the key algorithm once: keytool -list -v -keystore <release.keystore> -alias <alias> | grep -i 'Signature algorithm' |
|
@jvsena42 @ben-kaufman wdyt of splitting this into 2:
I keep seeing it is getting dragged by reproducibility concerns, while release workflow could've been already useful for building |

Closes #1006
Related: #953
Supersedes: #867 (closed as outdated in favor of #953)
This PR:
Caution
If you already have a private debug Firebase config at
app/google-services.json, move it before checking out this PR or pullingmasterafter this PR merges:app/google-services.jsonis now the tracked placeholder for fresh clones. Keepapp/src/mainnetRelease/google-services.jsonunchanged for release builds.Description
The core change is adding protected manual
releaseandrelease-internalGitHub Actions workflows. Both workflows build signed mainnet release artifacts from protected environment secrets.releasekeeps both APK and AAB outputs for Play/GitHub release handling, whilerelease-internalproduces the mainnet APK signed with the internal keystore. These workflows do not run automatically on pushed tags;/releaseremains the release-process orchestrator until it is deliberately updated to consume workflow-produced artifacts.The reproducibility support adds a manual
Reproducible Releaseworkflow andscripts/reproduce-release.shto buildbundleMainnetRelease, recreate APK splits with bundletool, extractarm64-v8anative libraries, and upload checksum evidence. When a comparison artifact is provided,diffoscopedifferences now fail the workflow while still uploading the generated report.GitHub Actions setup:
releaseandrelease-internalGitHub environments for the protected release workflows.releaseenvironment secrets:MAINNET_RELEASE_GOOGLE_SERVICES_JSON_BASE64,BITKIT_KEYSTORE_BASE64,BITKIT_KEYSTORE_PASSWORD,BITKIT_KEY_ALIAS, andBITKIT_KEY_PASSWORD.release-internalenvironment secrets:MAINNET_RELEASE_GOOGLE_SERVICES_JSON_BASE64,INTERNAL_KEYSTORE_BASE64,INTERNAL_KEYSTORE_PASSWORD,INTERNAL_KEY_ALIAS, andINTERNAL_KEY_PASSWORD.GPR_USERandGPR_TOKENremain optional fallback secrets; the workflows prefer the built-in GitHub Actions token withpackages: read.Remaining upstream work for #953:
/releaseso it can trigger/download thereleaseworkflow artifacts instead of relying on local APK creation.bitkit-core-android/ Rust-native AAR builds reproducible upstream.Cargo.lock, build paths,SOURCE_DATE_EPOCH, path remapping, stripping, and published native.sochecksums.androidx.datastore:datastore-coreandnet.java.dev.jna:jnawith diffoscope evidence.Preview
N/A
QA Notes
Manual Tests
app/src/debug/google-services.json) so one file can override the checked-inapp/google-services.jsonplaceholder without dirtying Git;app/src/mainnetRelease/google-services.jsonremains the release-only path.Automated Checks
bash -n scripts/reproduce-release.sh.github/workflows/release.yml,.github/workflows/release-internal.yml, and.github/workflows/reproducible-release.ymlapp/src/debug/google-services.jsonpath while keeping release secrets atapp/src/mainnetRelease/google-services.jsonbash -nfor the release signature verification shell blocksgit diff --checkgit check-ignore -v app/src/debug/google-services.json app/src/mainnetRelease/google-services.jsonsrc/debug/google-services.jsonresolves before the checked-in rootapp/google-services.jsonplaceholder, whilesrc/mainnetRelease/google-services.jsonremains the release override. The root placeholder intentionally omits the productionto.bitkitclient.go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/reproducible-release.yml .github/workflows/release.yml .github/workflows/release-internal.yml4aa52470d: lint and detekt passed; build/E2E jobs were skipped while the PR was draft.