Skip to content

Commit ccd3efe

Browse files
committed
Improve release instructions
1 parent fdd2f87 commit ccd3efe

File tree

3 files changed

+75
-48
lines changed

3 files changed

+75
-48
lines changed

RELEASING.md

Lines changed: 31 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,64 +18,51 @@ Also check if you can upgrade any dependencies:
1818
make update-dependency-versions
1919
```
2020

21-
## Make the release ##
21+
## Decide what the next version should be ##
22+
23+
Versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html). To sum it up, it depends on what's changed (see `CHANGELOG.md`). Given a version number MAJOR.MINOR.PATCH:
2224

23-
In order to make releases secrets are required. Members of the core
24-
team can install keybase and join the `cucumberbdd` team to access these secrets.
25+
* Bump `MAJOR` when you make incompatible API changes:
26+
* There are `Removed` entries, or `Changed` entries breaking compatibility
27+
* A cucumber library dependency upgrade was major
28+
* Bump `MINOR` when you add functionality in a backwards compatible manner:
29+
* There are `Added` entries, `Changed` entries preserving compatibility, or
30+
`Deprecated` entries
31+
* Bump `PATCH` when you make backwards compatible bug fixes:
32+
* There are `Fixed` entries
2533

26-
Remove the empty sections in the changelog. Don't commit these but run:
34+
Display future version by running:
2735

2836
```
2937
make version
3038
```
3139

32-
Check if branch name and version are as expected.
40+
Check if branch name and version are as expected. To change version run:
3341

3442
```
35-
make release
36-
```
43+
mvn versions:set -DnewVersion=X.Y.Z-SNAPSHOT
44+
```
3745

38-
# GPG Keys #
46+
## Secrets ##
3947

40-
To make a release you must have the `[email protected]` GPG private key imported in gpg2.
48+
Secrets are required to make releases. Members of the core team can install
49+
keybase and join the `cucumberbdd` team to access these secrets.
4150

42-
```
43-
gpg --import devs-cucumber.io.key
44-
```
51+
During the release process, secrets are fetched from keybase and used to sign
52+
and upload the maven artifacts.
4553

46-
Additionally upload privileges to the Sonatype repositories are required. See the
47-
[OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for instructions. Then an
48-
administrator will have to grant you access to the cucumber repository.
54+
## Make the release ##
4955

50-
Finally both your OSSRH credentials and private key must be setup in your `~/.m2/settings.xml` -
51-
for example:
56+
Check if branch name and version are as expected:
5257

5358
```
54-
<settings>
55-
<servers>
56-
<server>
57-
<id>ossrh</id>
58-
<username>sonatype-user-name</username>
59-
<password>sonatype-password</password>
60-
</server>
61-
</servers>
62-
<profiles>
63-
<profile>
64-
<id>ossrh</id>
65-
<activation>
66-
<activeByDefault>true</activeByDefault>
67-
</activation>
68-
<properties>
69-
<gpg.executable>gpg2</gpg.executable>
70-
<gpg.useagent>true</gpg.useagent>
71-
</properties>
72-
</profile>
73-
<profile>
74-
<id>sign-with-cucumber-key</id>
75-
<properties>
76-
<gpg.keyname>dev-cucumber.io-key-id</gpg.keyname>
77-
</properties>
78-
</profile>
79-
</profiles>
80-
</settings>
59+
make version
60+
```
61+
62+
Do the release:
63+
8164
```
65+
make release
66+
```
67+
68+
All done! Hurray!
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
function start_buffering() {
2+
buf = $0
3+
}
4+
function store_line_in_buffer() {
5+
buf = buf ORS $0
6+
}
7+
function clear_buffer() {
8+
buf = ""
9+
}
10+
/^### (Added|Changed|Deprecated|Removed|Fixed)$/ {
11+
start_buffering()
12+
next
13+
}
14+
/^## / {
15+
clear_buffer()
16+
}
17+
/^ *$/ {
18+
if (buf != "") {
19+
store_line_in_buffer()
20+
} else {
21+
print $0
22+
}
23+
}
24+
!/^ *$/ {
25+
if (buf != "") {
26+
print buf
27+
clear_buffer()
28+
}
29+
print $0
30+
}

scripts/update-changelog.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -uf -o pipefail
66
# * The [Unreleased] diff link is updated
77
# * A new diff link for the new release is added
88
# * The ## [Unreleased] header is changed to a version header with date
9+
# * The empty sections are removed
910
# * A new, empty [Unreleased] paragraph is added at the top
1011
#
1112

@@ -43,7 +44,7 @@ changelog=$(echo "${changelog}" | sed "s/## \[Unreleased\] (In Git)/## \[${new_v
4344
# Update [Unreleased] diff link
4445
line_number_colon_unreleased_link=$(echo "${changelog}" | grep -n "\[Unreleased\]")
4546
line_number=$(echo "${line_number_colon_unreleased_link}" | cut -d: -f1)
46-
unreleased_link=$(echo "${line_number_colon_unreleased_link}" | cut -d' ' -f2)
47+
unreleased_link=$(echo "${line_number_colon_unreleased_link}" | awk '{print $2}')
4748

4849
if [[ "${unreleased_link}" =~ \/v([0-9]+\.[0-9]+\.[0-9]+(-RC[0-9]+)?) ]]; then
4950
last_version="${BASH_REMATCH[1]}"
@@ -59,12 +60,21 @@ insertion_line_number=$((line_number + 1))
5960
release_link=$(echo "${changelog}" | head -n ${insertion_line_number} | tail -1)
6061
new_release_link=$(echo "${release_link}" | \
6162
sed "s/${last_version}/${new_version}/g" | \
62-
sed "s/v[0-9]\+.[0-9]\+.[0-9]\+/v${last_version}/")
63+
sed -E "s/v[0-9]\+.[0-9]\+.[0-9]\+/v${last_version}/")
6364

64-
changelog=$(echo "${changelog}" | sed "${insertion_line_number} i ${new_release_link}")
65+
changelog=$(echo "${changelog}" | sed "${insertion_line_number} i \\
66+
${new_release_link}
67+
")
68+
69+
# Remove empty sections
70+
71+
scripts_path="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
72+
changelog=$(echo "${changelog}" | awk -f "${scripts_path}/remove-empty-sections-changelog.awk")
6573

6674
# Insert a new [Unreleased] header
6775

68-
changelog=$(echo "${changelog}" | sed "s/----/----\n${header_escaped}\n/g")
76+
changelog=$(echo "${changelog}" | sed "s/----/----\\
77+
${header_escaped}\\
78+
/g")
6979

7080
echo "${changelog}"

0 commit comments

Comments
 (0)