|
2 | 2 |
|
3 | 3 | This document outlines the process for releasing the mParticle Android SDK and its kits. |
4 | 4 |
|
5 | | -## Step 1: Preparing the SDK for Release |
| 5 | +The Android SDK and kits are released together from this monorepo using GitHub Actions. |
6 | 6 |
|
7 | | -The Android SDK and kits are released using GitHub Actions. The SDK and kits are currently coupled together in the release process. |
| 7 | +## Release workflows |
8 | 8 |
|
9 | | -### Pre-release Checklist |
| 9 | +### Release - Draft |
10 | 10 |
|
11 | | -- Ensure all commits are in the public main branch |
12 | | -- Review `release.yml` in the repo for specific workflow details |
13 | | -- The release job deploys the most current snapshot of main branch release tag to main branch |
| 11 | +Use `Release - Draft` to prepare a release PR. The workflow: |
14 | 12 |
|
15 | | -## Step 2: Release via GitHub Actions |
| 13 | +1. Reads the current version from `VERSION`. |
| 14 | +2. Computes the next release version from `bump-type` and optional `qualifier`. |
| 15 | +3. Writes the computed version back to `VERSION`. |
| 16 | +4. Publishes to Maven local as a smoke test. |
| 17 | +5. Generates the changelog entry. |
| 18 | +6. Opens a PR back into the branch selected in the workflow dispatch UI. |
16 | 19 |
|
17 | | -### What the GitHub Release Job Does |
| 20 | +Generated release PR branches use `release/prep-<version>`, for example `release/prep-6.0.0-rc1`. |
18 | 21 |
|
19 | | -1. **Initial Setup** |
20 | | - - Verifies job is running from public repo and on main branch |
21 | | - - Creates temporary `release/{run_number}` branch |
| 22 | +### Release - Publish |
22 | 23 |
|
23 | | -2. **Testing Phase** |
24 | | - - Runs unit and instrumented tests in parallel |
25 | | - - Instrumented tests require an emulator |
26 | | - - Unit tests run independently |
27 | | - - Updates kits and runs additional tests |
| 24 | +`Release - Publish` runs when `VERSION` changes on: |
28 | 25 |
|
29 | | -3. **Version Management** |
30 | | - - Runs semantic version action |
31 | | - - Automatically bumps `build.gradle` version based on commit messages |
32 | | - - No version bump if no new commits (e.g., feat/fix) |
33 | | - - Generates release notes automatically |
34 | | - - Requires linear history between development and main branches |
| 26 | +- `main` |
| 27 | +- `workstation/*` |
35 | 28 |
|
36 | | -4. **Artifact Publishing** |
37 | | - - Uploads artifacts to Sonatype (core and kits) |
38 | | - - Builds and signs the core SDK and all kit artifacts |
39 | | - - Uploads to Sonatype Nexus (staging area) |
40 | | - - Syncs artifacts to Maven Central |
41 | | - > Note: This step will be moved before version bump during semantic release |
| 29 | +The workflow publishes the SDK and kits to Maven Central using the exact version in `VERSION`, then creates a GitHub release with the same tag. |
42 | 30 |
|
43 | | -5. **Branch Synchronization** |
44 | | - - Pushes release branch to: |
45 | | - - Public main branch |
46 | | - - Public development branch |
47 | | - - Internal repo main branch |
48 | | - - Deletes release branch on success (preserved on failure for debugging) |
| 31 | +## Stable releases |
49 | 32 |
|
50 | | -### How to Release |
| 33 | +1. Run `Release - Draft` from the target branch. |
| 34 | +2. Choose `patch`, `minor`, or `major` for `bump-type`. |
| 35 | +3. Leave `qualifier` empty. |
| 36 | +4. Review, approve, and merge the generated release PR. |
| 37 | +5. Confirm `Release - Publish` succeeds. |
51 | 38 |
|
52 | | -1. Navigate to the Actions tab |
53 | | -2. Select "release SDK" |
54 | | -3. Run the workflow from main branch with "true" first to perform a dry run |
55 | | - > Important: Always start with a dry run to validate the release process. This will perform all steps up to semantic release without actually publishing, helping catch potential issues early. |
56 | | -4. If the dry run succeeds, run the workflow again with "false" option to perform the actual release |
57 | | - > Note: Only proceed with the actual release after confirming a successful dry run |
| 39 | +Stable releases are marked as the latest GitHub release. |
58 | 40 |
|
59 | | -### Important Notes |
| 41 | +## Alpha, beta, and RC releases |
60 | 42 |
|
61 | | -- **Release Duration**: Expect ~20 minutes due to comprehensive test suite |
62 | | -- **Emulator Issues**: |
63 | | - - Sometimes GitHub Actions emulators fail |
64 | | - - We have a custom script to install and start the emulator `scripts/install-start-emulator.sh` |
65 | | - - OS version is hardcoded to avoid issues with new releases |
66 | | -- **Code Reusability**: |
67 | | - - Reusable GitHub Actions are defined in the [mparticle-workflows repo](https://github.com/mParticle/mparticle-workflows) |
68 | | - - This enables other platforms to reuse similar jobs |
| 43 | +Use a qualified release when a partner or internal validation flow needs a fixed Maven Central version before the stable release, for example `6.0.0-alpha1`, `6.0.0-beta1`, or `6.0.0-rc1`. |
69 | 44 |
|
70 | | -## Post-Release Verification |
| 45 | +1. Run `Release - Draft` from the target branch, such as `workstation/6.0-Release`. |
| 46 | +2. Choose the base `bump-type`: |
| 47 | + - `patch`, `minor`, or `major` to bump the base version. |
| 48 | + - `none` to keep the base version unchanged and only change or remove the qualifier. |
| 49 | +3. Set `qualifier` to the pre-release identifier without the leading hyphen, for example `alpha1`, `beta1`, or `rc1`. |
| 50 | +4. Review, approve, and merge the generated release PR. |
| 51 | +5. Confirm `Release - Publish` succeeds. |
71 | 52 |
|
72 | | -After a successful build through GitHub Actions, verify: |
| 53 | +Qualified releases are published to Maven Central with the exact qualified version. Their GitHub releases are marked as pre-releases and are not marked as latest. |
73 | 54 |
|
74 | | -1. Public repo has a new semantic release tag |
75 | | -2. New artifact is present in [Sonatype](https://central.sonatype.com/publishing) |
| 55 | +The qualifier must start with an alphanumeric character and may only contain alphanumerics, dots, and hyphens. |
| 56 | + |
| 57 | +## Version examples |
| 58 | + |
| 59 | +- `5.78.2` with `bump-type=minor` and `qualifier=alpha1` produces `5.79.0-alpha1`. |
| 60 | +- `5.79.0-alpha1` with `bump-type=none` and `qualifier=beta1` produces `5.79.0-beta1`. |
| 61 | +- `5.79.0-beta1` with `bump-type=none` and `qualifier=rc1` produces `5.79.0-rc1`. |
| 62 | +- `5.79.0-rc1` with `bump-type=none` and an empty `qualifier` produces `5.79.0`. |
| 63 | + |
| 64 | +The draft workflow rejects any input combination that would produce the same version already stored in `VERSION`. |
| 65 | + |
| 66 | +## Post-release verification |
| 67 | + |
| 68 | +After a successful publish workflow, verify: |
| 69 | + |
| 70 | +1. The GitHub release exists with the expected tag. |
| 71 | +2. The SDK artifact is present in [Sonatype](https://central.sonatype.com/publishing). |
| 72 | +3. The kit artifacts are present in [Sonatype](https://central.sonatype.com/publishing). |
| 73 | +4. Pre-release tags are marked as pre-releases and stable tags are marked as latest. |
76 | 74 |
|
77 | 75 | ## Troubleshooting |
78 | 76 |
|
79 | | -If you encounter emulator issues during testing, check: |
| 77 | +If release validation fails: |
80 | 78 |
|
81 | | -- [Emulator setup script](https://github.com/mParticle/mparticle-android-sdk/blob/main/scripts/install-start-emulator.sh) |
82 | | -- Current OS version compatibility |
83 | | -- GitHub Actions logs for specific error messages |
| 79 | +- Check the generated release PR for the computed `VERSION` and changelog changes. |
| 80 | +- Check the Maven local smoke-test step in `Release - Draft`. |
| 81 | +- Check the Maven Central publish steps in `Release - Publish`. |
| 82 | +- For emulator-related validation issues, check `scripts/install-start-emulator.sh` and the GitHub Actions logs. |
0 commit comments