Skip to content

Use Github release automation #2500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Release on GitHub

on:
push:
branches: [release/*]

jobs:
pre-release-check:
uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main
34 changes: 34 additions & 0 deletions .github/workflows/release-java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release maven package

on:
push:
branches: [release/*]

jobs:
pre-release-check:
uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main

test-java:
uses: ./.github/workflows/build.yml

publish-mvn:
name: Publish Maven Package
needs: [pre-release-check, test-java]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have referenced test, not test-java.

runs-on: ubuntu-latest
environment: Release

steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: "11"
cache: "maven"

- uses: cucumber/[email protected]
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus-username: cukebot
nexus-password: ${{ secrets.SONATYPE_PASSWORD }}
29 changes: 2 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,7 @@ update-changelog:
git push
.PHONY: .commit-and-push-changelog

.configure-cukebot-in-docker:
[ -f '/home/cukebot/configure' ] && /home/cukebot/configure
.PHONY: .configure-cukebot-in-docker

.release-in-docker: .configure-cukebot-in-docker default update-changelog .commit-and-push-changelog
.release: default update-changelog .commit-and-push-changelog
mvn --batch-mode release:clean release:prepare -DautoVersionSubmodules=true -Darguments="-DskipTests=true -DskipITs=true -Darchetype.test.skip=true"
git checkout "v$(NEW_VERSION)"
mvn deploy -P-examples -P-compatibility -Psign-source-javadoc -DskipTests=true -DskipITs=true -Darchetype.test.skip=true
git checkout $(CURRENT_BRANCH)
git fetch
.PHONY: .release-in-docker

release:
[ -d '../secrets' ] || git clone keybase://team/cucumberbdd/secrets ../secrets
git -C ../secrets pull
../secrets/update_permissions
docker run \
--volume "${shell pwd}":/app \
--volume "${shell pwd}/../secrets/configure":/home/cukebot/configure \
--volume "${shell pwd}/../secrets/codesigning.key":/home/cukebot/codesigning.key \
--volume "${shell pwd}/../secrets/gpg-with-passphrase":/home/cukebot/gpg-with-passphrase \
--volume "${shell pwd}/../secrets/.ssh":/home/cukebot/.ssh \
--volume "${HOME}/.m2/repository":/home/cukebot/.m2/repository \
--env-file "${shell pwd}/../secrets/secrets.list" \
--user 1000 \
--rm \
-it cucumber/cucumber-build:0.1.0@sha256:2ce049493dfadad62b78594e6728d1f85ccc5a2441b5a8b3f7a106a7bba39ec1 \
make .release-in-docker
git push origin $$(git rev-list --max-count=1 v$(NEW_VERSION)):refs/heads/release/v$(NEW_VERSION)
.PHONY: release
20 changes: 10 additions & 10 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,26 @@ Check if branch name and version are as expected. To change version run:
mvn versions:set -DnewVersion=X.Y.Z-SNAPSHOT
```

## Secrets ##

Secrets are required to make releases. Members of the core team can install
keybase and join the `cucumberbdd` team to access these secrets.

During the release process, secrets are fetched from keybase and used to sign
and upload the maven artifacts.

## Make the release ##

Check if branch name and version are as expected:
Only people with permission to push to `release/*` branches can make releases.

1. Check if branch name and version are as expected:

```
make version
```

Do the release:
2. Do the release:

```
make release
```

3. Wait until the `release-*` workflows have passed for the new release branch:
* [![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)
* [![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)

## Last bits ##

Update the cucumber-jvm version in the documentation project:
Expand All @@ -74,3 +72,5 @@ Update the cucumber-jvm version in the documentation project:
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)

All done! Hurray!

[changelog]: https://github.com/cucumber/changelog#installation