Skip to content

Commit 450cff7

Browse files
authored
Better release docs. (#3)
* Better release docs. * Add note to PR not to squash merge a release. * Document when changes are not pushed to origin.
1 parent a3ac7a6 commit 450cff7

File tree

2 files changed

+42
-6
lines changed

2 files changed

+42
-6
lines changed

release/README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,54 @@
22

33
## Install requirements
44

5-
Install Python 3 and required packages:
5+
### Python 3
6+
7+
A working python 3 installation is required by the cargo-version.py script.
8+
9+
Install required packages:
610

711
pip install -r release/requirements.txt
812

13+
### Update PATH
14+
915
Add the `release` folder to your `PATH`.
1016

17+
### Optional: GitHub CLI
18+
19+
Optionally, if you want to have a GitHub Pull-Request automatically created, you need the GitHib command line tools installed and properly configured. See https://cli.github.com/.
20+
1121
## Usage
1222

1323
Go to the folder containing a Cargo workspace or crate and run:
1424

15-
release.sh [major|minor|patch]
25+
release.sh [major|minor|patch] [false]
1626

1727
This pushes two commits in a newly created release branch. When merging, __do not squash them__.
1828

29+
Examples:
30+
31+
# Perform release raise the minor version
32+
$ release.sh
33+
34+
# Perform a release but do not push anything to origin
35+
$ release.sh minor false
36+
37+
# Perform a release and raise the major version
38+
$ release.sh major
39+
40+
## Description
41+
42+
The release process performs the following steps:
43+
0. Create a release branch from `main`.
44+
1. Update the release version in the cargo workspace by dropping the "-nightly" token.
45+
2. Update `Cargo.lock` with the new version.
46+
3. Commit and tag the release.
47+
4. Set the version to the next development version by increasing the 'minor' (by default) part and adding the '-nightly' prerelease token.
48+
5. Update `Cargo.lock` with the new version.
49+
6. Commit the next release.
50+
7. Push the two commits. This is skipped if the second argument was `false`.
51+
8. __Optional__: if the GitHub cli is installed, a PR is created. This is also skipped if the second argument was `false`.
52+
53+
## Future development
1954

55+
Automatically update the change log and readme files.

release/release.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ maybe_create_github_pr() {
2525
local TAG=$1
2626
GH_COMMAND=$(which gh)
2727
if [ "$GH_COMMAND" != "" ]; then
28-
gh pr create --base $BASE_BRANCH --head $RELEASE_BRANCH --reviewer "@stackabletech/rust-developers" --title "Release $TAG" --body "Release $TAG"
28+
gh pr create --base $BASE_BRANCH --head $RELEASE_BRANCH --reviewer "@stackabletech/rust-developers" --title "Release $TAG" --body "Release $TAG. DO NOT SQUASH MERGE!"
2929
fi
3030
}
3131

@@ -50,13 +50,13 @@ main() {
5050
#
5151
cargo-version.py --next ${NEXT_LEVEL}
5252
cargo update --workspace
53-
TAG=$(cargo-version.py --show)
54-
git commit -am "bump version $TAG"
53+
local NEXT_TAG=$(cargo-version.py --show)
54+
git commit -am "bump version $NEXT_TAG"
5555

5656
if [ "$PUSH" = "true" ]; then
5757
git push ${REPOSITORY} ${RELEASE_BRANCH}
5858
git push --tags
59-
maybe_create_github_pr $TAG_NAME
59+
maybe_create_github_pr $TAG
6060
fi
6161
}
6262

0 commit comments

Comments
 (0)