mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-23 22:08:46 +00:00
Add release guide & script to cut release
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
acbd240070
commit
a90d8a1439
@ -9,3 +9,98 @@ You can update Play Store releae metadata using `fastlane android upload_metadat
|
||||
But that requires credentials necessary for accessing Play Store API. The simpler way is to edit files contained within [`fastlane/metadata`](metadata) and run the following CI job:
|
||||
|
||||
https://ci.status.im/job/status-react/job/tools/job/update-playstore-metadata/
|
||||
|
||||
# Release process
|
||||
|
||||
## Coordination
|
||||
|
||||
All the coordination is done in the #release channel on discord.
|
||||
|
||||
## Using the script
|
||||
|
||||
You can use the script to cut a release branch:
|
||||
|
||||
`scripts/cut-release.sh`
|
||||
|
||||
This will create a branch:
|
||||
|
||||
`release/a.b.x`
|
||||
|
||||
Create a branch:
|
||||
|
||||
`chore/update-release-to-$version`
|
||||
|
||||
And if you have the `gh` command installed, it will automatically create a PR for you.
|
||||
|
||||
## Manual steps
|
||||
|
||||
### Create a branch
|
||||
|
||||
First we need to create a release branch cut from develop.
|
||||
The name of the branch should be `release/a.b.x` where `x` is actually `x`, not
|
||||
a variable, and `a` and `b` are the `MAJOR` and `MINOR` version of the app.
|
||||
|
||||
For example, valid branch names are:
|
||||
|
||||
`release/1.12.x` or `release/3.12.x`
|
||||
|
||||
|
||||
### Update version
|
||||
|
||||
We need to update the `VERSION` file to reflect the release we want to build.
|
||||
|
||||
|
||||
## Building
|
||||
|
||||
Jenkins will automatically build this branch and create release candidates.
|
||||
Those will go through the QA process and the QA team will let us know when
|
||||
tested successfully.
|
||||
|
||||
## Bugfixes before app is released
|
||||
|
||||
Because both `status-react` and `status-go` might have newer commits that we don't
|
||||
want to include, bug fixes should be applied separately to develop and the release branch.
|
||||
The best workflow is to send a PR to develop, get it merged and the cherry-pick on the
|
||||
release branch.
|
||||
|
||||
If that's not practical for some reason (i.e develop has diverged significantly from release)
|
||||
other workflows are possible.
|
||||
|
||||
In order to change status-go, a similar workflow applies.
|
||||
First checkout the tag used in `status-go-version.json`.
|
||||
|
||||
Create a branch on status-go named: `release/vx.y.z+hotfix.w` where
|
||||
|
||||
`x` is the `MAJOR` version
|
||||
`y` is the `MINOR` version
|
||||
`z` is the `PATCH` version
|
||||
`w` is the `HOTFIX` version
|
||||
|
||||
For example valid names are:
|
||||
|
||||
`release/v0.62.3+hotfix.2`
|
||||
`release/v1.3.4+hotfix.4`
|
||||
|
||||
Once the branch is ready to use and tested successfully, tag the branch:
|
||||
|
||||
`git tag v0.62.3+hotfix.2`
|
||||
|
||||
and push the tag to origin:
|
||||
|
||||
`git push origin v0.62.3+hotfix.2`
|
||||
|
||||
Once that's done, update the status-react branch with the new tag:
|
||||
|
||||
`make shell`
|
||||
|
||||
`scripts/update-status-go.sh v0.62.3+hotfix.2`
|
||||
|
||||
And commit and push the changes
|
||||
|
||||
# Hotfix process
|
||||
|
||||
The hotfix process is basically identical to the workflow above:
|
||||
|
||||
1) Add the changes on status-react
|
||||
2) Make sure you use a hotfix branch for status-go (unless we are happy to release from develop)
|
||||
3) Update the `VERSION` in status-react
|
||||
|
85
scripts/cut-release.sh
Normal file
85
scripts/cut-release.sh
Normal file
@ -0,0 +1,85 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Increment a version string using Semantic Versioning (SemVer) terminology.
|
||||
|
||||
# Parse command line options.
|
||||
|
||||
set -e
|
||||
|
||||
if ! git diff-index --quiet HEAD; then
|
||||
echo "Your Git working directory is not clean!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while getopts ":Mmp" Option
|
||||
do
|
||||
case $Option in
|
||||
M ) major=true;;
|
||||
m ) minor=true;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
echo "Checking out develop..."
|
||||
git checkout develop
|
||||
|
||||
echo "Pulling latest develop..."
|
||||
git pull
|
||||
|
||||
version=$(cat VERSION)
|
||||
|
||||
if [[ -z $major ]] && [[ -z $minor ]]; then
|
||||
minor=true
|
||||
fi
|
||||
|
||||
# Build array from version string.
|
||||
|
||||
a=( ${version//./ } )
|
||||
|
||||
# If version string is missing or has the wrong number of members, show usage message.
|
||||
|
||||
if [ ${#a[@]} -ne 3 ]
|
||||
then
|
||||
echo "usage: $(basename $0) [-Mmp]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Increment version numbers as requested.
|
||||
|
||||
if [ ! -z $major ]
|
||||
then
|
||||
((a[0]++))
|
||||
a[1]=0
|
||||
a[2]=0
|
||||
fi
|
||||
|
||||
if [ ! -z $minor ]
|
||||
then
|
||||
((a[1]++))
|
||||
a[2]=0
|
||||
fi
|
||||
|
||||
newversion=${a[0]}.${a[1]}.${a[2]}
|
||||
releasebranch="${a[0]}.${a[1]}.x"
|
||||
echo "Cutting release branch $newversion"
|
||||
|
||||
prbranch="chore/update-release-to-$newversion"
|
||||
|
||||
|
||||
git checkout -b $prbranch
|
||||
echo $newversion > VERSION
|
||||
git add VERSION
|
||||
git commit -m "Bump release to $newversion"
|
||||
git push --set-upstream origin $prbranch
|
||||
echo "Creating PR..."
|
||||
if ! command -v gh &> /dev/null
|
||||
then
|
||||
echo "Github command line not present, don't forget to create one"
|
||||
else
|
||||
gh pr create --title "Bump release to $newversion" --body "status:ready"
|
||||
fi
|
||||
|
||||
echo "Creating release branch..."
|
||||
git checkout -b release/$releasebranch
|
||||
echo "Release branch created, push to origin to start building"
|
Loading…
x
Reference in New Issue
Block a user