|
| 1 | +# Release Workflow Design |
| 2 | + |
| 3 | +**Goal:** Automate the full release process — from git tag to Maven Central publication and GitHub Release creation. |
| 4 | + |
| 5 | +**Current state:** Publishing is done manually from a local machine via `./gradlew publish` with credentials in `local.properties`. No automated release workflow exists. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Trigger |
| 10 | + |
| 11 | +Push a git tag matching `v*` (e.g., `v2.0.5`): |
| 12 | + |
| 13 | +```bash |
| 14 | +git tag v2.0.5 |
| 15 | +git push origin v2.0.5 |
| 16 | +``` |
| 17 | + |
| 18 | +## Pipeline |
| 19 | + |
| 20 | +``` |
| 21 | +git push tag v2.0.5 |
| 22 | + ↓ |
| 23 | +GitHub Actions (release.yml): |
| 24 | + 1. Checkout + Setup JDK 21 |
| 25 | + 2. Validate: tag version == libs.versions.toml vbpd version |
| 26 | + 3. ./gradlew check (build + tests + detekt + ktlint) |
| 27 | + 4. ./gradlew publishAllPublicationsToMavenCentralRepository |
| 28 | + 5. Create GitHub Release (tag message as changelog) |
| 29 | + 6. Upload AAR artifacts to GitHub Release |
| 30 | +``` |
| 31 | + |
| 32 | +## Versioning |
| 33 | + |
| 34 | +Tag must match the version in `gradle/libs.versions.toml` (`vbpd = "2.0.5"`). CI validates this at step 2 — fails fast if mismatch. This prevents accidental releases with wrong versions. |
| 35 | + |
| 36 | +## Credentials |
| 37 | + |
| 38 | +Stored as GitHub Secrets: |
| 39 | + |
| 40 | +| Secret | Purpose | |
| 41 | +|--------|---------| |
| 42 | +| `SIGNING_KEY_ID` | GPG key ID for signing | |
| 43 | +| `SIGNING_KEY` | Base64-encoded GPG private key | |
| 44 | +| `SIGNING_PASSWORD` | GPG key passphrase | |
| 45 | +| `MAVEN_CENTRAL_USERNAME` | Sonatype Central Portal username | |
| 46 | +| `MAVEN_CENTRAL_PASSWORD` | Sonatype Central Portal token | |
| 47 | + |
| 48 | +## Changes Required |
| 49 | + |
| 50 | +### New files |
| 51 | +- `.github/workflows/release.yml` — tag-triggered release workflow |
| 52 | + |
| 53 | +### Modified files |
| 54 | +- `gradle/convetions-plugins/vbpd-library-base/src/main/kotlin/vbpdpublish.gradle.kts` — read credentials from environment variables (fallback to local.properties for local dev) |
| 55 | +- `README.md` — add CI status and Maven Central version badges |
| 56 | + |
| 57 | +### Deleted files |
| 58 | +- `jitpack.yml` — JitPack is not used, config is outdated (JDK 11) |
| 59 | + |
| 60 | +## Design Decisions |
| 61 | + |
| 62 | +- **Tag-triggered** over workflow_dispatch: prevents accidental releases, ties version to git history |
| 63 | +- **Version validation** over auto-extraction: explicit control, no build script magic |
| 64 | +- **Environment variables** over secrets file: standard CI pattern, Vanniktech plugin supports it natively |
| 65 | +- **Keep local.properties fallback**: developers can still publish locally if needed |
0 commit comments