Skip to content

Commit 9b2b968

Browse files
committed
New release process
1 parent 797f74e commit 9b2b968

File tree

9 files changed

+168
-153
lines changed

9 files changed

+168
-153
lines changed

.github/project.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: SmallRye Reactive Messaging
2+
release:
3+
previous-version: 4.25.0
4+
current-version: 4.26.0-RC1
5+
next-version: 999-SNAPSHOT
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Prepare Release
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
paths:
8+
- '.github/project.yml'
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
prepare-release:
16+
name: Prepare Release
17+
if: ${{ github.event.pull_request.merged == true}}
18+
uses: smallrye/.github/.github/workflows/prepare-release.yml@main
19+
secrets: inherit
20+
21+
after-release:
22+
name: After release
23+
needs: prepare-release
24+
runs-on: ubuntu-latest
25+
if: ${{ github.event.pull_request.merged == true}}
26+
27+
steps:
28+
- name: Create GitHub App Token
29+
id: app-token
30+
uses: actions/create-github-app-token@v1
31+
with:
32+
app-id: ${{ vars.CI_APP_ID }}
33+
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}
34+
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
ref: ${{ github.ref }}
39+
token: ${{steps.app-token.outputs.token}}
40+
41+
- name: Get GitHub App User ID
42+
id: get-user-id
43+
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
44+
env:
45+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
46+
47+
- name: Configure Git author
48+
run: |
49+
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
50+
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
51+
52+
- name: Update files
53+
run: |
54+
echo "✅ Clear RevAPI justifications, if any"
55+
jbang .build/CompatibilityUtils.java clear
56+
if [[ $(git diff --stat) != '' ]]; then
57+
git add -A
58+
git status
59+
git commit -m "[POST-RELEASE] - Clearing breaking change justifications"
60+
git push
61+
else
62+
echo "No justifications cleared"
63+
fi

.github/workflows/push-deploy-docs.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Deploy Docs Smallrye Reactive Messaging
1+
name: Deploy Docs
2+
run-name: Deploy ${{github.event.inputs.version || github.ref_name}} Docs
23

34
on:
45
workflow_dispatch:
@@ -9,17 +10,12 @@ on:
910
jobs:
1011
deploy-docs:
1112
runs-on: ubuntu-latest
12-
env:
13-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
14-
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
15-
RELEASE_VERSION: ${{ github.event.inputs.version }}
1613

1714
steps:
1815
- name: Git checkout
1916
uses: actions/checkout@v4
2017
with:
2118
fetch-depth: 0
22-
token: ${{ secrets.RELEASE_TOKEN }}
2319
- name: Java setup
2420
uses: actions/setup-java@v4
2521
with:
@@ -36,9 +32,5 @@ jobs:
3632
cache-dependency-path: documentation/Pipfile.lock
3733
- name: Install pipenv
3834
run: pip install pipenv
39-
- name: Set Release Version
40-
run: |
41-
echo "RELEASE_VERSION=${RELEASE_VERSION:-"$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)"}" >> $GITHUB_ENV
4235
- name: Perform the deploy docs
43-
run: |
44-
just build-ci deploy-docs
36+
run: just build-ci deploy-docs ${{ github.event.inputs.version }}

.github/workflows/push-release-to-maven-central.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 29 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,37 @@
1-
name: Release Smallrye Reactive Messaging
1+
name: Release
2+
run-name: Perform ${{github.event.inputs.tag || github.ref_name}} Release
23

34
on:
5+
push:
6+
tags:
7+
- '*'
48
workflow_dispatch:
59
inputs:
6-
previousVersion:
7-
description: 'Previous version'
10+
tag:
11+
description: 'Tag to release'
812
required: true
9-
version:
10-
description: 'Release version'
11-
required: true
12-
deployWebsite:
13-
description: 'Shall we deploy the website?'
14-
required: true
15-
default: 'true'
16-
clearRevAPI:
17-
description: 'Shall we clear RevAPI justifications?'
18-
required: true
19-
default: 'true'
13+
14+
permissions:
15+
attestations: write
16+
id-token: write
17+
# Needed for the publish-* workflows
18+
contents: write
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: true
2023

2124
jobs:
22-
release:
23-
runs-on: ubuntu-latest
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
26-
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
27-
RELEASE_VERSION: ${{ github.event.inputs.version }}
28-
DEPLOY_WEBSITE: ${{ github.event.inputs.deployWebsite }}
29-
CLEAR_REVAPI: ${{ github.event.inputs.clearRevAPI }}
30-
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
31-
JRELEASER_TAG_NAME: ${{ github.event.inputs.version }}
32-
JRELEASER_PREVIOUS_TAG_NAME: ${{ github.event.inputs.previousVersion }}
33-
JRELEASER_GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
25+
perform-release:
26+
name: Perform Release
27+
uses: smallrye/.github/.github/workflows/perform-release.yml@main
28+
secrets: inherit
29+
with:
30+
version: ${{github.event.inputs.tag || github.ref_name}}
3431

35-
steps:
36-
- name: Git checkout
37-
uses: actions/checkout@v4
38-
with:
39-
fetch-depth: 0
40-
token: ${{ secrets.RELEASE_TOKEN }}
41-
- name: Java setup
42-
uses: actions/setup-java@v4
43-
with:
44-
java-version: '17'
45-
distribution: 'temurin'
46-
cache: maven
47-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
48-
gpg-passphrase: 'MAVEN_GPG_PASSPHRASE'
49-
- name: Install just
50-
uses: taiki-e/install-action@just
51-
- name: Setup Python
52-
uses: actions/setup-python@v5
53-
with:
54-
python-version: 3.9
55-
cache: 'pipenv'
56-
cache-dependency-path: documentation/Pipfile.lock
57-
- name: Install pipenv
58-
run: pip install pipenv
59-
- name: Perform the release steps
60-
run: |
61-
curl -s "https://get.sdkman.io?rcupdate=false" | bash
62-
source ~/.sdkman/bin/sdkman-init.sh && sdk install jbang
63-
just perform-release
32+
deploy-site:
33+
name: GitHub Pages
34+
needs: perform-release
35+
uses: ./.github/workflows/push-deploy-docs.yml
36+
with:
37+
version: ${{github.event.inputs.tag || github.ref_name}}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Review Release
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/project.yml'
7+
8+
jobs:
9+
review-release:
10+
name: Review release
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Retrieve project metadata
15+
id: metadata
16+
uses: radcortez/project-metadata-action@main
17+
with:
18+
github-token: ${{secrets.GITHUB_TOKEN}}
19+
metadata-file-path: '.github/project.yml'
20+
21+
- name: Validate version
22+
if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT')
23+
run: |
24+
echo '::error::Cannot release a SNAPSHOT version.'
25+
exit 1
26+
27+
- name: Milestone review
28+
uses: radcortez/milestone-review-action@main
29+
with:
30+
github-token: ${{secrets.GITHUB_TOKEN}}
31+
milestone-title: ${{steps.metadata.outputs.current-version}}

RELEASING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Releasing SmallRye Reactive Messaging
2+
3+
The release process starts by creating PR with a release branch.
4+
5+
The release branch contains a change to `.github/project.yml` setting the `current-version` to the release version.
6+
7+
## Review the release PR
8+
9+
On creation the release PR is verified for the `current-version` and whether the milestone contains any open issues or PRs.
10+
11+
## Prepare the release
12+
13+
Once the release PR is merged, the prepare release workflow is triggered.
14+
15+
This workflow calls the maven-release-plugin prepare goal, which sets the release version in the `pom.xml` and pushes a release tag to the repository.
16+
17+
It also closes the milestone associated with the release.
18+
19+
Then the workflow clears any RevAPI justifications and pushes the changes to the target branch (main in regular releases).
20+
21+
## Perform the release
22+
23+
The release workflow is triggered on a push of a new tag (created by the prepare step).
24+
25+
It deploys artifacts locally and attaches them to the action artifacts.
26+
And publishes artifacts to the Maven Central using the Smallrye Release workflow.
27+
28+
When the Maven Central sync is complete, it deploys the website.
29+

justfile

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -24,72 +24,19 @@ build-ci:
2424
test-ci:
2525
./mvnw -B -ntp -s .build/ci-maven-settings.xml clean verify
2626

27-
# Perform a release
28-
perform-release: pre-release release post-release
29-
@echo "🎉 Successfully released Smallrye Reactive Messaging ${RELEASE_VERSION} 🚀"
30-
31-
# Initialize Git
32-
init-git:
33-
@echo "🔀 Git setup"
34-
git config --global user.name "smallrye-ci"
35-
git config --global user.email "smallrye@googlegroups.com"
36-
37-
# Steps before releasing
38-
pre-release: init-git
39-
@echo "🚀 Pre-release steps..."
40-
@if [[ -z "${RELEASE_TOKEN}" ]]; then exit 1; fi
41-
@if [[ -z "${RELEASE_VERSION}" ]]; then exit 1; fi
42-
@echo "Pre-release verifications"
43-
jbang .build/PreRelease.java --token=${RELEASE_TOKEN} --release-version=${RELEASE_VERSION}
44-
@echo "Bump project version to ${RELEASE_VERSION}"
45-
./mvnw -B -ntp versions:set -DnewVersion=${RELEASE_VERSION} -DgenerateBackupPoms=false
46-
@echo "Check that the project builds (no tests)"
47-
./mvnw -B -ntp clean install -Prelease -DskipTests
48-
@echo "Check that the website builds"
49-
-[[ ${DEPLOY_WEBSITE} == "true" ]] && cd documentation && pipenv install && pipenv run mkdocs build
50-
51-
# Steps to release
52-
release: pre-release
53-
@echo "🚀 Release steps..."
54-
@if [[ -z "${JRELEASER_TAG_NAME}" ]]; then exit 1; fi
55-
@if [[ -z "${JRELEASER_PREVIOUS_TAG_NAME}" ]]; then exit 1; fi
56-
@if [[ -z "${JRELEASER_GITHUB_TOKEN}" ]]; then exit 1; fi
57-
@echo "Commit release version and push upstream"
58-
git commit -am "[RELEASE] - Bump version to ${RELEASE_VERSION}"
59-
git push
60-
jbang .build/CompatibilityUtils.java extract
61-
@echo "Call JReleaser"
62-
./mvnw -B -ntp jreleaser:full-release -Pjreleaser -pl :smallrye-reactive-messaging
63-
-[[ ${DEPLOY_WEBSITE} == "true" ]] && just deploy-docs
64-
@echo "Bump to 999-SNAPSHOT and push upstream"
65-
./mvnw -B -ntp versions:set -DnewVersion=999-SNAPSHOT -DgenerateBackupPoms=false
66-
git commit -am "[RELEASE] - Next development version: 999-SNAPSHOT"
67-
git push
68-
69-
# Deploy to Maven Central
70-
deploy-to-maven-central:
71-
@echo "🔖 Deploy to Maven Central"
72-
./mvnw -B -ntp deploy -Prelease -DskipTests
73-
74-
# Steps post-release
75-
post-release:
76-
@echo "🚀 Post-release steps..."
77-
-[[ ${CLEAR_REVAPI} == "true" ]] && just clear-revapi
78-
7927
# Update Pulsar Connector Configuration Documentation
8028
update-pulsar-config-docs:
8129
@echo "📝 Updating Pulsar connector configuration docs"
8230
jbang .build/PulsarConfigDoc.java -d documentation/src/main/docs/pulsar/config
8331

8432
# Deploy documentation
85-
deploy-docs:
33+
deploy-docs version:
8634
#!/usr/bin/env bash
8735
echo "📝 Deploying documentation to GitHub"
88-
if [[ -z "${RELEASE_VERSION}" ]]; then exit 1; fi
8936
./mvnw -B -ntp clean compile -pl documentation
9037
cd documentation
9138
pipenv install
92-
pipenv run mike deploy --update-aliases --push --remote origin "${RELEASE_VERSION}" "latest"
39+
pipenv run mike deploy --update-aliases --push --remote origin {{version}} "latest"
9340

9441
# Clear RevAPI justifications
9542
clear-revapi:

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111

112112
<jandex-maven-plugin.version>3.2.3</jandex-maven-plugin.version>
113113
<sundr-maven-plugin.version>0.200.0</sundr-maven-plugin.version>
114+
<maven-deploy-plugin.version>3.1.3</maven-deploy-plugin.version>
114115

115116
<nats-embedded.version>2.1.3</nats-embedded.version>
116117
<slf4j-log4j12.version>2.0.16</slf4j-log4j12.version>
@@ -606,6 +607,11 @@
606607
</pluginManagement>
607608

608609
<plugins>
610+
<plugin>
611+
<groupId>org.apache.maven.plugins</groupId>
612+
<artifactId>maven-deploy-plugin</artifactId>
613+
<version>${maven-deploy-plugin.version}</version>
614+
</plugin>
609615
<plugin>
610616
<groupId>io.smallrye</groupId>
611617
<artifactId>jandex-maven-plugin</artifactId>

0 commit comments

Comments
 (0)