From fb3069109654ef004ed4e8d4890b759f4acde0db Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 16 Mar 2022 18:58:44 -0700 Subject: [PATCH 1/6] Add release workflows --- .github/workflows/release-github.yml | 22 ++++++++++++++++++ .github/workflows/release-java.yml | 34 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/release-github.yml create mode 100644 .github/workflows/release-java.yml diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml new file mode 100644 index 0000000000..a4f841390a --- /dev/null +++ b/.github/workflows/release-github.yml @@ -0,0 +1,22 @@ +name: Release on GitHub + +on: + push: + branches: [release/*] + +jobs: + pre-release-check: + uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main + + create-github-release: + name: Create GitHub Release and Git tag + runs-on: ubuntu-latest + needs: [pre-release-check] + environment: Release + permissions: + contents: write + steps: + - uses: actions/checkout@v2 + - uses: cucumber/action-create-github-release@v1.1.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-java.yml b/.github/workflows/release-java.yml new file mode 100644 index 0000000000..7571aa9e7f --- /dev/null +++ b/.github/workflows/release-java.yml @@ -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] + 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/action-publish-mvn@v1.1.0 + with: + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }} + nexus-username: cukebot + nexus-password: ${{ secrets.SONATYPE_PASSWORD }} From abbc6f2bb8cbda55444834c40c2fccf9053da2f9 Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 16 Mar 2022 19:04:22 -0700 Subject: [PATCH 2/6] Update Makefile to push to release branch --- Makefile | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 923ebd30d9..9b2e99c6db 100644 --- a/Makefile +++ b/Makefile @@ -49,32 +49,8 @@ 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 + COMMIT_ID=$(git rev-list --max-count=1 v$(NEW_VERSION)) + git push origin $(COMMIT_ID):refs/heads/release/v$(NEW_VERSION) .PHONY: release From 8367fb98c6a906579a5c9be833f6cdab67691efd Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 16 Mar 2022 19:10:05 -0700 Subject: [PATCH 3/6] Update RELEASING instructions --- RELEASING.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index c6591bcb85..a47be76667 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -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: @@ -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 From abdd8547575e8457e3ccaed637a269720623f86e Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Thu, 17 Mar 2022 09:00:39 -0700 Subject: [PATCH 4/6] Test parsing changelog in CI. This is only neccesary to test this piece of infrastructure and should be reverted before the PR is merged. --- .github/workflows/parse-changelog.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/parse-changelog.yml diff --git a/.github/workflows/parse-changelog.yml b/.github/workflows/parse-changelog.yml new file mode 100644 index 0000000000..41fe78e413 --- /dev/null +++ b/.github/workflows/parse-changelog.yml @@ -0,0 +1,16 @@ +name: Parse changelog + +on: + push: + +jobs: + changelog: + name: "Changelog" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: cucumber/action-changelog@v1.3 + id: changelog + with: + args: latest + - run: echo ${{ steps.changelog.outputs.result }} From 2df690bcd9b29fd189d0763e8f2f73a730e98e64 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sun, 20 Mar 2022 00:36:52 +0100 Subject: [PATCH 5/6] Disable github release --- .github/workflows/parse-changelog.yml | 16 ---------------- .github/workflows/release-github.yml | 13 ------------- 2 files changed, 29 deletions(-) delete mode 100644 .github/workflows/parse-changelog.yml diff --git a/.github/workflows/parse-changelog.yml b/.github/workflows/parse-changelog.yml deleted file mode 100644 index 41fe78e413..0000000000 --- a/.github/workflows/parse-changelog.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Parse changelog - -on: - push: - -jobs: - changelog: - name: "Changelog" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: cucumber/action-changelog@v1.3 - id: changelog - with: - args: latest - - run: echo ${{ steps.changelog.outputs.result }} diff --git a/.github/workflows/release-github.yml b/.github/workflows/release-github.yml index a4f841390a..dc00a8d4dc 100644 --- a/.github/workflows/release-github.yml +++ b/.github/workflows/release-github.yml @@ -7,16 +7,3 @@ on: jobs: pre-release-check: uses: cucumber/.github/.github/workflows/prerelease-checks.yml@main - - create-github-release: - name: Create GitHub Release and Git tag - runs-on: ubuntu-latest - needs: [pre-release-check] - environment: Release - permissions: - contents: write - steps: - - uses: actions/checkout@v2 - - uses: cucumber/action-create-github-release@v1.1.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} From 12f34f6e9912a31394021675149bdc5af6ed3e5f Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Sun, 20 Mar 2022 00:38:54 +0100 Subject: [PATCH 6/6] Remove untested changes --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9b2e99c6db..e2a76e0f52 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,5 @@ update-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" - COMMIT_ID=$(git rev-list --max-count=1 v$(NEW_VERSION)) - git push origin $(COMMIT_ID):refs/heads/release/v$(NEW_VERSION) + git push origin $$(git rev-list --max-count=1 v$(NEW_VERSION)):refs/heads/release/v$(NEW_VERSION) .PHONY: release