Skip to content

Commit 748e8ce

Browse files
mattwynnegaeljw
andauthored
Add automated release workflows and update releasing guide (#269)
* Add automated release workflows and update releaseing guide * Remove old Make targets for releasing * Use cucumber sbt action for release Co-authored-by: Gaël Jourdan-Weil <[email protected]>
1 parent a6a4766 commit 748e8ce

File tree

5 files changed

+91
-103
lines changed

5 files changed

+91
-103
lines changed

.github/workflows/release-github.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release on GitHub
2+
3+
on:
4+
push:
5+
branches: [release/*]
6+
7+
jobs:
8+
pre-release-check:
9+
uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main
10+
11+
create-github-release:
12+
name: Create GitHub Release and Git tag
13+
runs-on: ubuntu-latest
14+
needs: [pre-release-check]
15+
environment: Release
16+
permissions:
17+
contents: write
18+
steps:
19+
- uses: actions/checkout@v2
20+
- uses: cucumber/[email protected]
21+
with:
22+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-sbt.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release scala package
2+
3+
on:
4+
push:
5+
branches:
6+
- release/*
7+
8+
jobs:
9+
pre-release-check:
10+
uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main
11+
12+
build:
13+
uses: ./.github/workflows/build.yml
14+
15+
publish-mvn:
16+
name: Publish Maven Package
17+
needs: [pre-release-check, build]
18+
runs-on: ubuntu-latest
19+
environment: Release
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- uses: actions/setup-java@v2
25+
with:
26+
distribution: "temurin"
27+
java-version: "11"
28+
- uses: cucumber/[email protected]
29+
with:
30+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
31+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
32+
nexus-username: cukebot
33+
nexus-password: ${{ secrets.SONATYPE_PASSWORD }}
34+
working-directory: .

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
release.properties
66
pom.xml.releaseBackup
77
pom.xml.versionsBackup
8+
.metals/
9+
.vscode/

Makefile

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,11 @@ default:
55
.PHONY: default
66

77
VERSION = $(shell sbt "print cucumberScala/version" | tail -n 1)
8-
NEW_VERSION = $(subst -SNAPSHOT,,$(VERSION))
9-
CURRENT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
108

119
clean:
1210
sbt clean
1311
.PHONY: clean
1412

15-
version:
16-
@echo ""
17-
@echo "The next version of Cucumber-Scala will be $(NEW_VERSION) and released from '$(CURRENT_BRANCH)'"
18-
@echo ""
19-
.PHONY: version
20-
2113
update-installdoc:
2214
cat docs/install.md | ./scripts/update-install-doc.sh $(NEW_VERSION) > docs/install.md.tmp
2315
mv docs/install.md.tmp docs/install.md
@@ -28,37 +20,7 @@ update-changelog:
2820
mv CHANGELOG.md.tmp CHANGELOG.md
2921
.PHONY: update-changelog
3022

31-
.commit-and-push-changelog-and-docs:
23+
prepare-release: update-changelog update-installdoc .commit-and-push-changelog-and-docs
3224
git commit -am "Update CHANGELOG and docs for v$(NEW_VERSION)"
3325
git push
34-
.PHONY: .commit-and-push-changelog
35-
36-
.configure-cukebot-in-docker:
37-
[ -f '/root/configure' ] && /root/configure
38-
.PHONY: .configure-cukebot-in-docker
39-
40-
.release-in-docker: .configure-cukebot-in-docker default update-changelog update-installdoc .commit-and-push-changelog-and-docs
41-
sbt "release cross with-defaults"
42-
.PHONY: release-in-docker
43-
44-
release:
45-
[ -d '../secrets' ] || git clone keybase://team/cucumberbdd/secrets ../secrets
46-
git -C ../secrets reset HEAD --hard
47-
git -C ../secrets pull
48-
../secrets/update_permissions
49-
docker pull cucumber/cucumber-build:latest
50-
docker run \
51-
--volume "${shell pwd}":/app \
52-
--volume "${shell pwd}/../secrets/configure":/root/configure \
53-
--volume "${shell pwd}/../secrets/codesigning.key":/root/codesigning.key \
54-
--volume "${shell pwd}/../secrets/gpg-with-passphrase":/root/gpg-with-passphrase \
55-
--volume "${shell pwd}/../secrets/.ssh":/root/.ssh \
56-
--volume "${HOME}/.ivy2":/root/.ivy2 \
57-
--volume "${HOME}/.cache/coursier":/root/.cache/coursier \
58-
--volume "${HOME}/.cache/sbt":/root/.cache/sbt \
59-
--env-file "${shell pwd}/../secrets/secrets.list" \
60-
--rm \
61-
-it cucumber/cucumber-build:latest \
62-
make .release-in-docker
63-
.PHONY: release
64-
26+
.PHONY: prepare-release

RELEASING.md

Lines changed: 31 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,34 @@
11
Releasing
22
=========
33

4-
The deployment process of `cucumber-jvm-scala` is based on
5-
[Deploying to OSSRH with Apache Maven](http://central.sonatype.org/pages/apache-maven.html#deploying-to-ossrh-with-apache-maven-introduction).
6-
7-
## Check [![Build Status](https://travis-ci.org/cucumber/cucumber-jvm-scala.svg?branch=main)](https://travis-ci.org/cucumber/cucumber-jvm-scala) ##
8-
9-
Is the build passing?
10-
11-
```
12-
git checkout main
13-
sbt clean +test
14-
```
15-
16-
Also check if you can upgrade any dependencies:
17-
- check RenovateBot open Merge Requests on Github
18-
19-
## Decide what the next version should be ##
20-
21-
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:
22-
23-
* Bump `MAJOR` when you make incompatible API changes:
24-
* There are `Removed` entries, or `Changed` entries breaking compatibility
25-
* A cucumber library dependency upgrade was major
26-
* Bump `MINOR` when you add functionality in a backwards compatible manner:
27-
* There are `Added` entries, `Changed` entries preserving compatibility, or
28-
`Deprecated` entries
29-
* Bump `PATCH` when you make backwards compatible bug fixes:
30-
* There are `Fixed` entries
31-
32-
Display future version by running:
33-
34-
```
35-
make version
36-
```
37-
38-
Check if branch name and version are as expected. To change version, update the _version.sbt_ file:
39-
40-
```
41-
version in ThisBuild := "6.8.3-SNAPSHOT"
42-
```
43-
44-
## Secrets ##
45-
46-
Secrets are required to make releases. Members of the core team can install
47-
keybase and join the `cucumberbdd` team to access these secrets.
48-
49-
During the release process, secrets are fetched from keybase and used to sign
50-
and upload the maven artifacts.
51-
52-
## Make the release ##
53-
54-
Check if branch name and version are as expected:
55-
56-
```
57-
make version
58-
```
59-
60-
Do the release:
61-
62-
```
63-
make release
64-
```
65-
66-
All done! Hurray!
4+
Releases are automated via a [GitHub Actions workflow](./.github/workflows/release-sbt.yml). Only people with permission to push to `release/*` branches can make releases.
5+
6+
See [Cucumber release process](https://github.com/cucumber/.github/blob/main/RELEASING.md) for the whole process.
7+
8+
## Preparation
9+
10+
1. Decide what the next version should be according to semver
11+
```bash
12+
export $next_release=<version> # <- insert version number here
13+
```
14+
1. Update the `version.sbt` file with version to release:
15+
```bash
16+
echo "ThisBuild / version := \"$next_release\"" > version.sbt
17+
```
18+
1. Update the CHANGELOG and documentation, commit and push:
19+
```bash
20+
make prepare-release
21+
```
22+
23+
## Release
24+
25+
1. Push to a new `release/*` branch to trigger the `release-*` workflows
26+
```bash
27+
git push origin main:release/v$next_release
28+
```
29+
1. Wait until the `release-*` workflows in GitHub Actions have passed
30+
1. In `version.sbt`, bump the **patch** version and append `-SNAPSHOT` (e.g. `1.2.4-SNAPSHOT`) and commit/push
31+
1. Announce the release
32+
* in the `#newsletter` Slack channel
33+
* on the `@cucumberbdd` Twitter account
34+
* write a blog post

0 commit comments

Comments
 (0)