Implement secure CI/CD signing architecture with separate test/release environments #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements the design doc's secure signing architecture with key isolation between untrusted PR builds and production releases. Renames package to
org.joefang.webdavand adds fork attribution.Signing Architecture
build.yml: Unsigned builder, no secrets accesssign-test.yml: Signs PR builds viaci:testenvironment (test key)sign-release.yml: Signs main/tags viaci:releaseenvironment (release key)build-release.yaml,ci-build.yml,release.yml)Package & Flavors
dev.rocli.android.webdav→org.joefang.webdavprod→org.joefang.webdavuntrusted→org.joefang.webdav.test(side-by-side installation)Version Naming
v{M}.{m}.{p}v5.4.3v{M}.{m}.{p}-dev.{count}+{sha}v5.4.4-dev.42+a1b2c3dci-test-untrusted-{M}.{m}.{p}-dev.{count}+{sha}ci-test-untrusted-5.4.4-dev.42+a1b2c3dDocumentation
alexbakker/webdav-provider, no compatibility guaranteeOriginal prompt
Your task is to ensure the CI/CD binary signing flow completely conforms to the new standard. Note that the current CI/CD flow already conforms to the standard reasonably well and handles the major.minor.patch+commit_since logic correctly, but there are still some discrepencies in details (e.g. how the version names are formatted). I want you to work on the conformace to bring this CI/CD pipeline in line with the best practices. Please follow best practices and write idiomatic code, and ensure the signing keys for untrusted test binaries are completely separate from the signing keys for pre-releases and releases. Please also ensure you upload untrusted but signed test binaries to Actions artifacts so our testers can download and install them to test out. Note that since we have implemented this isolation, the untrusted binaries can be signed without maintainer's approval and automatically generated for every PR so we can more efficiently test out, but please make it very clear in the docs/ that thest ".test" variants are untrusted by us and are signed for convenience of tests using a separate keypair.
In the meantime, since we have made significant changes to the original project that we don't intend to maintain any kind of compatibility with the original project, I want you to rename the android package name to org.joefang.webdav (and org.joefang.webdav.test for the untrusted test binaries) and revamp the current Gradle scripts to bring them in line with best practices and idiomatic configurations. Also make the documentation very clear that we have forked from where, and attribute the original author (keep a link to the original repo) while making it very clear we are a separate project with a different package name with no compatibility guaranteed.
Design Doc: Secure Android CI/CD Signing & Versioning Architecture
1. Objective
Establish a unified, secure signing pipeline across Android projects that:
ci:test,ci:release) so untrusted PR code never accesses them..test) to exist alongside Production APKs.2. Infrastructure & Key Management
2.1. GitHub Environments
Create two environments per repository to segregate access:
ci:testReviewers: None (Automated).
ci:releasemain,v*.Reviewers: Recommended.
2.2. Key Generation Standard
To ensure alignment, generate keys for each environment using the exact commands below.
ANDROID_KEYSTORE_B64,ANDROID_KEYSTORE_PASSWORD,ANDROID_KEY_ALIAS.3. Project Configuration (Gradle)
3.1. Build Variants (Co-installation)
In
app/build.gradle.kts, define flavors so the test app has a distinctapplicationId.android { namespace = "org.joefang.letterbox" // Canonical Namespace defaultConfig { applicationId = "org.joefang.letterbox" } flavorDimensions += "env" productFlavors { create("prod") { dimension = "env" // Installs as: org.joefang.letterbox } create("test") { dimension = "env" // Installs as: org.joefang.letterbox.test applicationIdSuffix = ".test" } } }3.2. Versioning Strategy
Implement dynamic versioning in
app/build.gradle.kts. This enforces the "untrusted" naming convention for test builds.