Skip to content

Commit 1e711be

Browse files
Use Github release automation (#2500)
Co-authored-by: M.P. Korstanje <[email protected]>
1 parent 4e688d1 commit 1e711be

File tree

4 files changed

+55
-37
lines changed

4 files changed

+55
-37
lines changed

.github/workflows/release-github.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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

.github/workflows/release-java.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release maven package
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+
test-java:
12+
uses: ./.github/workflows/build.yml
13+
14+
publish-mvn:
15+
name: Publish Maven Package
16+
needs: [pre-release-check, test-java]
17+
runs-on: ubuntu-latest
18+
environment: Release
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- uses: actions/setup-java@v2
24+
with:
25+
distribution: "temurin"
26+
java-version: "11"
27+
cache: "maven"
28+
29+
- uses: cucumber/[email protected]
30+
with:
31+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
32+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
33+
nexus-username: cukebot
34+
nexus-password: ${{ secrets.SONATYPE_PASSWORD }}

Makefile

+2-27
Original file line numberDiff line numberDiff line change
@@ -49,32 +49,7 @@ update-changelog:
4949
git push
5050
.PHONY: .commit-and-push-changelog
5151

52-
.configure-cukebot-in-docker:
53-
[ -f '/home/cukebot/configure' ] && /home/cukebot/configure
54-
.PHONY: .configure-cukebot-in-docker
55-
56-
.release-in-docker: .configure-cukebot-in-docker default update-changelog .commit-and-push-changelog
52+
release: default update-changelog .commit-and-push-changelog
5753
mvn --batch-mode release:clean release:prepare -DautoVersionSubmodules=true -Darguments="-DskipTests=true -DskipITs=true -Darchetype.test.skip=true"
58-
git checkout "v$(NEW_VERSION)"
59-
mvn deploy -P-examples -P-compatibility -Psign-source-javadoc -DskipTests=true -DskipITs=true -Darchetype.test.skip=true
60-
git checkout $(CURRENT_BRANCH)
61-
git fetch
62-
.PHONY: .release-in-docker
63-
64-
release:
65-
[ -d '../secrets' ] || git clone keybase://team/cucumberbdd/secrets ../secrets
66-
git -C ../secrets pull
67-
../secrets/update_permissions
68-
docker run \
69-
--volume "${shell pwd}":/app \
70-
--volume "${shell pwd}/../secrets/configure":/home/cukebot/configure \
71-
--volume "${shell pwd}/../secrets/codesigning.key":/home/cukebot/codesigning.key \
72-
--volume "${shell pwd}/../secrets/gpg-with-passphrase":/home/cukebot/gpg-with-passphrase \
73-
--volume "${shell pwd}/../secrets/.ssh":/home/cukebot/.ssh \
74-
--volume "${HOME}/.m2/repository":/home/cukebot/.m2/repository \
75-
--env-file "${shell pwd}/../secrets/secrets.list" \
76-
--user 1000 \
77-
--rm \
78-
-it cucumber/cucumber-build:0.1.0@sha256:2ce049493dfadad62b78594e6728d1f85ccc5a2441b5a8b3f7a106a7bba39ec1 \
79-
make .release-in-docker
54+
git push origin $$(git rev-list --max-count=1 v$(NEW_VERSION)):refs/heads/release/v$(NEW_VERSION)
8055
.PHONY: release

RELEASING.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,26 @@ Check if branch name and version are as expected. To change version run:
4343
mvn versions:set -DnewVersion=X.Y.Z-SNAPSHOT
4444
```
4545

46-
## Secrets ##
47-
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.
50-
51-
During the release process, secrets are fetched from keybase and used to sign
52-
and upload the maven artifacts.
53-
5446
## Make the release ##
5547

56-
Check if branch name and version are as expected:
48+
Only people with permission to push to `release/*` branches can make releases.
49+
50+
1. Check if branch name and version are as expected:
5751

5852
```
5953
make version
6054
```
6155

62-
Do the release:
56+
2. Do the release:
6357

6458
```
6559
make release
6660
```
6761

62+
3. Wait until the `release-*` workflows have passed for the new release branch:
63+
* [![Release maven package](https://github.com/cucumber/cucumber-jvm/actions/workflows/release-java.yml/badge.svg)](https://github.com/cucumber/cucumber-jvm/actions/workflows/release-java.yml)
64+
* [![Release on GitHub](https://github.com/cucumber/cucumber-jvm/actions/workflows/release-github.yml/badge.svg)](https://github.com/cucumber/cucumber-jvm/actions/workflows/release-github.yml)
65+
6866
## Last bits ##
6967

7068
Update the cucumber-jvm version in the documentation project:
@@ -74,3 +72,5 @@ Update the cucumber-jvm version in the documentation project:
7472
The cucumber-jvm version for the docs is specified in the docs [versions.yaml](https://github.com/cucumber/docs.cucumber.io/blob/master/data/versions.yaml)
7573

7674
All done! Hurray!
75+
76+
[changelog]: https://github.com/cucumber/changelog#installation

0 commit comments

Comments
 (0)