Skip to content

Commit ce7b707

Browse files
mpkorstanjemattwynne
andcommittedAug 7, 2022
Use GitHub release automation (#2502)
Cucumber-JVM can now be released with Polyglot Release[1]. Polyglot Release will prepare the project for release. Once prepared the changes are pushed and the GitHub Action[2] will publish the release. 1: https://github.com/cucumber/polyglot-release 2: https://github.com/cucumber/action-publish-mvn Co-authored-by: M.P. Korstanje <[email protected]> Co-authored-by: Matt Wynne <[email protected]>
1 parent 3afe4b9 commit ce7b707

File tree

6 files changed

+62
-127
lines changed

6 files changed

+62
-127
lines changed
 

‎.github/workflows/release-github.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Release GitHub
2+
3+
on:
4+
push:
5+
branches: [release/*]
6+
7+
jobs:
8+
create-github-release:
9+
name: Create GitHub Release and Git tag
10+
runs-on: ubuntu-latest
11+
environment: Release
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: cucumber/action-create-github-release@v1.1.0
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/release-java.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Maven
2+
3+
on:
4+
push:
5+
branches: [release/*]
6+
7+
jobs:
8+
publish-mvn:
9+
name: Publish Maven Package
10+
runs-on: ubuntu-latest
11+
environment: Release
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-java@v3
15+
with:
16+
distribution: 'temurin'
17+
java-version: '11'
18+
cache: 'maven'
19+
- uses: cucumber/action-publish-mvn@v2.0.0
20+
with:
21+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
22+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
23+
nexus-username: ${{ secrets.SONATYPE_USERNAME }}
24+
nexus-password: ${{ secrets.SONATYPE_PASSWORD }}

‎.github/workflows/build.yml ‎.github/workflows/test-java.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
name: Cucumber CI
1+
name: Test Java
22

33
on:
44
pull_request:
55
branches:
66
- '**'
7+
workflow_call:
78
push:
89
branches:
910
- main
@@ -31,9 +32,9 @@ jobs:
3132
with:
3233
version: '11'
3334
- name: Install dependencies
34-
run: mvn install -DskipTests=true -DskipITs=true -Darchetype.test.skip=true -Dmaven.javadoc.skip=true -B --show-version
35+
run: mvn install -Pinclude-extra-modules -DskipTests=true -DskipITs=true -Darchetype.test.skip=true -Dmaven.javadoc.skip=true -B --show-version
3536
- name: Test
36-
run: mvn verify
37+
run: mvn verify -Pinclude-extra-modules
3738
env:
3839
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
3940

@@ -75,9 +76,9 @@ jobs:
7576
with:
7677
version: '11'
7778
- name: Install dependencies
78-
run: mvn install -DskipTests=true -DskipITs=true -Darchetype.test.skip=true -Dmaven.javadoc.skip=true --batch-mode --show-version
79+
run: mvn install -Pinclude-extra-modules -DskipTests=true -DskipITs=true -Darchetype.test.skip=true -Dmaven.javadoc.skip=true --batch-mode --show-version
7980
- name: Test (Coverage)
80-
run: mvn jacoco:prepare-agent verify jacoco:report
81+
run: mvn jacoco:prepare-agent verify jacoco:report -Pinclude-extra-modules
8182
- uses: codecov/codecov-action@v3
8283
with:
8384
fail_ci_if_error: true

‎Makefile

-50
Original file line numberDiff line numberDiff line change
@@ -29,53 +29,3 @@ endif
2929
cp -r target/compatibility-kit/devkit/samples/* compatibility/src/test/resources/features
3030
rm -rf target/compatibility-kit
3131
.PHONY: update-cck
32-
33-
update-dependency-versions:
34-
mvn versions:force-releases
35-
mvn versions:update-properties -DallowMajorUpdates=false -Dmaven.version.rules="file://`pwd`/.versions/rules.xml"
36-
.PHONY: update-dependency-versions
37-
38-
update-major-dependency-versions:
39-
mvn versions:force-releases
40-
mvn versions:update-properties -DallowMajorUpdates=true -Dmaven.version.rules="file://`pwd`/.versions/rules.xml"
41-
.PHONY: update-major-dependency-versions
42-
43-
update-changelog:
44-
cat CHANGELOG.md | ./scripts/update-changelog.sh $(NEW_VERSION) > CHANGELOG.md.tmp
45-
mv CHANGELOG.md.tmp CHANGELOG.md
46-
.PHONY: update-changelog
47-
48-
.commit-and-push-changelog:
49-
git commit -am "Update CHANGELOG for v$(NEW_VERSION)"
50-
git push
51-
.PHONY: .commit-and-push-changelog
52-
53-
.configure-cukebot-in-docker:
54-
[ -f '/home/cukebot/configure' ] && /home/cukebot/configure
55-
.PHONY: .configure-cukebot-in-docker
56-
57-
.release-in-docker: .configure-cukebot-in-docker default update-changelog .commit-and-push-changelog
58-
mvn --batch-mode release:clean release:prepare -DautoVersionSubmodules=true -Darguments="-DskipTests=true -DskipITs=true -Darchetype.test.skip=true"
59-
git checkout "v$(NEW_VERSION)"
60-
mvn deploy -P-build-in-ci -Psign-source-javadoc -DskipTests=true -DskipITs=true -Darchetype.test.skip=true
61-
git checkout $(CURRENT_BRANCH)
62-
git fetch
63-
.PHONY: .release-in-docker
64-
65-
release:
66-
[ -d '../secrets' ] || git clone keybase://team/cucumberbdd/secrets ../secrets
67-
git -C ../secrets pull
68-
../secrets/update_permissions
69-
docker run \
70-
--volume "${shell pwd}":/app \
71-
--volume "${shell pwd}/../secrets/configure":/home/cukebot/configure \
72-
--volume "${shell pwd}/../secrets/codesigning.key":/home/cukebot/codesigning.key \
73-
--volume "${shell pwd}/../secrets/gpg-with-passphrase":/home/cukebot/gpg-with-passphrase \
74-
--volume "${shell pwd}/../secrets/.ssh":/home/cukebot/.ssh \
75-
--volume "${HOME}/.m2/repository":/home/cukebot/.m2/repository \
76-
--env-file "${shell pwd}/../secrets/secrets.list" \
77-
--user 1000 \
78-
--rm \
79-
-it cucumber/cucumber-build:0.1.0@sha256:2ce049493dfadad62b78594e6728d1f85ccc5a2441b5a8b3f7a106a7bba39ec1 \
80-
make .release-in-docker
81-
.PHONY: release

‎RELEASING.md

+2-67
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,6 @@
1-
Releasing
2-
=========
1+
See [.github/RELEASING](https://github.com/cucumber/.github/blob/main/RELEASING.md).
32

4-
The deployment process of `cucumber-jvm` 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://github.com/cucumber/cucumber-jvm/workflows/Cucumber%20CI/badge.svg)](https://github.com/cucumber/cucumber-jvm/actions) ##
8-
9-
Is the build passing?
10-
11-
```
12-
git checkout main
13-
```
14-
15-
Also check if you can upgrade any dependencies:
16-
17-
```
18-
make update-dependency-versions
19-
```
20-
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:
24-
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
33-
34-
Display future version by running:
35-
36-
```
37-
make version
38-
```
39-
40-
Check if branch name and version are as expected. To change version run:
41-
42-
```
43-
mvn versions:set -DnewVersion=X.Y.Z-SNAPSHOT
44-
```
45-
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-
54-
## Make the release ##
55-
56-
Check if branch name and version are as expected:
57-
58-
```
59-
make version
60-
```
61-
62-
Do the release:
63-
64-
```
65-
make release
66-
```
67-
68-
## Last bits ##
3+
## When done ##
694

705
Update the cucumber-jvm version in the documentation project:
716

‎pom.xml

+12-5
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,25 @@
9292
</build>
9393
</profile>
9494

95+
<profile>
96+
<!-- Modules are not included by default when building in CI.
97+
Releases are also made from CI, and we do not want to release
98+
these modules. -->
99+
<id>include-extra-modules</id>
100+
<modules>
101+
<module>examples</module>
102+
<module>compatibility</module>
103+
</modules>
104+
</profile>
105+
95106
<profile>
96107
<id>build-in-ci</id>
97108
<activation>
98109
<property>
99-
<name>CI</name>
110+
<name>env.CI</name>
100111
<value>true</value>
101112
</property>
102113
</activation>
103-
<modules>
104-
<module>examples</module>
105-
<module>compatibility</module>
106-
</modules>
107114
<build>
108115
<pluginManagement>
109116
<plugins>

0 commit comments

Comments
 (0)
Please sign in to comment.