Release procedure - ankidroid/Anki-Android GitHub Wiki
This page describes how to release AnkiDroid. It can be interesting as an insight to understand the project better, or to improve the procedure.
Development lifecycle
There are three main phases the project alternates between (alpha, beta, stable).
We use a simple branching model where "main" (the default branch) contains the latest (unstable) development code, which is where all merge requests should be submitted. Alphas a released from main during this phase.
When we move into the "beta" phase of the development cycle, we create a branch "release-N.n" (N.n being the version code) which is only for important bug fixes. During this period, important bug fixes are cherry-picked from main on to the release branch by the development team into "release-N.n" (see below).
If an urgent bug is discovered shortly after a major release, commits will be added to that "release-N.n" branch and releases will be made from it.
Stable release procedure
Build
- Update the changelog in the ankidroiddocs repository and/or the manual with notable changes - the tools/release.sh script will help you by enforcing this
- Always use this repository: https://github.com/ankidroid/Anki-Android
- Consider syncing translations from crowdin if they are still backwards compatible (no strings were deleted) - do this on main and
cherry-pick -x commit-hash
to the release branch
Merging new changes from main into a release or hotfix branch
Check out the release branch and using git on the command line cherry-pick -x commit-hash
the commits from main that you want
Amazon App Store
This is a manual process as the amazon gradle publishing plugin is currently unmaintained, but Amazon has begun accepting our builds again
You need to be part of Nicolas Raoul's Amazon Developer organization (he can send you an invite, currently Mike Hardy is a member) and with that you authority you may create new releases and submit them for review / distribution. You will also need the Amazon App Store publishing credential JSON (similar to the Google Publishing JSON needed for the Play Store)
After running the release script, for public releases only, there should be a new release present on the Amazon App Store in unpublished state: https://developer.amazon.com/apps-and-games/console/apps/list.html - fill in the description for the release, and submit it for review
GitHub Automated Publish Workflow
Crowdin / translations sync
- Run the Sync Translations Action
- open that action
- find the button on the right labeled "Run Workflow"
- Run the workflow against the main branch
- Have someone review and approve the PR and merge it to main
- If no strings were deleted, and there is a release branch for the current release, then you may cherry-pick the i18n sync commit to the release branch as well, as it will be backwards-compatible. If strings were deleted then new strings must not be cherry-picked as the code will be looking for deleted strings and crash.
Cutting a new release branch
- Checkout the main branch and verify everything is working with a
./gradlew clean jacocoTestReport
- Make the branch, for example if you want
release-2.14
you do agit co -b release-2.14
- If the build.gradle has not been switched to beta yet, edit
AnkiDroid/build.gradle
to switch the version from alphaNN tobeta0
, like this (the release script will handle taking it from0
to1
on the first run) - If the build.gradle has already been switched to beta, then after you push the branch you must switch main to alpha numbering on the next version, and switch it back to the alpha track for play release, or the alpha builds will overwrite the beta ones
- If the build.gradle has not been switched to beta yet, edit
- Push the changes (for example if you are making
release-2.14
-git push --set-upstream origin release-2.14
) - Now follow the "Publishing new versions" section here, but select the new branch you just pushed
- The first beta usually goes to the Google Play Store alpha testing group. Later (after the first beta survives alpha testing and you manually promote to beta) when you want to publish it automatically to the beta channel, you need to change the appropriate line to be beta instead of alpha: https://github.com/ankidroid/Anki-Android/blob/aa61add0360596ca3e0cbf967a652496aee1be49/AnkiDroid/build.gradle#L183
Publishing new versions
- Run the Publish Action
- Open that action
- Find the button on the right labeled "Run Workflow"
- Run the workflow against the main branch for alphas, or the correct release branch for betas/public releases
- For public releases
- make sure changelog.asc in ankidroiddocs has an entry for the new version on it's main branch or the release script will abort
- go to the various stores (Google Play Store, Amazon App Store, Huawei AppGallery) and submit the new build for release