Skip to content

Commit 8b15823

Browse files
chore: bump version to 0.18.3-SNAPSHOT and fix release workflow
Align Maven publish version with the GitHub release tag, validate POM matches before deploy, fix bump job base branch resolution, and grant workflow permissions for git push and PR creation. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 9cc36e1 commit 8b15823

10 files changed

Lines changed: 38 additions & 29 deletions

File tree

.github/workflows/release.yml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
types:
66
- published
77

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
812
jobs:
913
sonar:
1014
if: "!contains(github.event.head_commit.message, '[version bump]')"
@@ -49,21 +53,23 @@ jobs:
4953
git config user.email "actions@github.com"
5054
git config user.name "GitHub Actions"
5155
52-
- name: Get version from POM without SNAPSHOT
56+
- name: Setup release version from tag
5357
run: |
54-
VERSION_PARTS=($(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d- -f1 | tr "." "\n"))
55-
echo "MAJOR=${VERSION_PARTS[0]}" >> $GITHUB_ENV
56-
echo "MINOR=${VERSION_PARTS[1]}" >> $GITHUB_ENV
57-
echo "PATCH=${VERSION_PARTS[2]}" >> $GITHUB_ENV
58+
RELEASE_TAG="${{ github.event.release.tag_name }}"
59+
NEW_VERSION="${RELEASE_TAG#v}"
60+
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
5861
59-
- name: Setup release version
62+
- name: Validate POM version matches release tag
6063
run: |
61-
NEW_VERSION="$((MAJOR)).$((MINOR)).$((PATCH))"
62-
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV
64+
POM_BASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d- -f1)
65+
if [ "${POM_BASE_VERSION}" != "${NEW_VERSION}" ]; then
66+
echo "::error::GitHub release tag v${NEW_VERSION} does not match POM version ${POM_BASE_VERSION}-SNAPSHOT. Bump the POM before publishing."
67+
exit 1
68+
fi
6369
6470
- name: Update POM Version
6571
run: |
66-
echo "New version is: $NEW_VERSION"
72+
echo "New version is: $NEW_VERSION"
6773
mvn versions:set -DnewVersion=${NEW_VERSION} -DgenerateBackupPoms=false -B
6874
6975
- name: Build and Publish
@@ -90,10 +96,17 @@ jobs:
9096
runs-on: ubuntu-latest
9197
needs: [ publish ]
9298
steps:
99+
- name: Resolve base branch
100+
id: base
101+
run: |
102+
REF="${{ github.event.release.target_commitish }}"
103+
REF="${REF#refs/heads/}"
104+
echo "branch=${REF}" >> $GITHUB_OUTPUT
105+
93106
- name: Checkout Branch
94107
uses: actions/checkout@v6
95108
with:
96-
ref: ${{ github.event.release.target_commitish }}
109+
ref: ${{ steps.base.outputs.branch }}
97110

98111
- name: Setup Java
99112
uses: actions/setup-java@v5
@@ -107,17 +120,13 @@ jobs:
107120
git config user.email "actions@github.com"
108121
git config user.name "GitHub Actions"
109122
110-
- name: Get version from POM without SNAPSHOT
111-
run: |
112-
VERSION_PARTS=($(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d- -f1 | tr "." "\n"))
113-
echo "MAJOR=${VERSION_PARTS[0]}" >> $GITHUB_ENV
114-
echo "MINOR=${VERSION_PARTS[1]}" >> $GITHUB_ENV
115-
echo "PATCH=${VERSION_PARTS[2]}" >> $GITHUB_ENV
116-
117123
- name: Bump And Update POM Version to new Development version
118124
id: bump_version
119125
run: |
120-
NEW_VERSION="$((MAJOR)).$((MINOR)).$((PATCH+1))-SNAPSHOT"
126+
RELEASE_VERSION="${{ github.event.release.tag_name }}"
127+
RELEASE_VERSION="${RELEASE_VERSION#v}"
128+
VERSION_PARTS=($(echo "$RELEASE_VERSION" | tr "." "\n"))
129+
NEW_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.$((VERSION_PARTS[2]+1))-SNAPSHOT"
121130
echo "New development version is: $NEW_VERSION"
122131
mvn versions:set -DnewVersion=${NEW_VERSION} -DgenerateBackupPoms=false
123132
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
@@ -129,5 +138,5 @@ jobs:
129138
title: "chore: bump version to ${{ steps.bump_version.outputs.new_version }}"
130139
body: "Bumps the version to the next development version."
131140
branch: "chore/bump-version-${{ steps.bump_version.outputs.new_version }}"
132-
base: ${{ github.event.release.target_commitish || 'main' }}
141+
base: ${{ steps.base.outputs.branch }}
133142
labels: automerge

boat-engine/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.18.2-SNAPSHOT</version>
8+
<version>0.18.3-SNAPSHOT</version>
99
</parent>
1010
<artifactId>boat-engine</artifactId>
1111
<packaging>jar</packaging>

boat-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.18.2-SNAPSHOT</version>
8+
<version>0.18.3-SNAPSHOT</version>
99
</parent>
1010
<artifactId>boat-maven-plugin</artifactId>
1111

boat-quay/boat-quay-lint/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>boat-quay</artifactId>
8-
<version>0.18.2-SNAPSHOT</version>
8+
<version>0.18.3-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>boat-quay-lint</artifactId>

boat-quay/boat-quay-rules/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>boat-quay</artifactId>
8-
<version>0.18.2-SNAPSHOT</version>
8+
<version>0.18.3-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>boat-quay-rules</artifactId>

boat-quay/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.18.2-SNAPSHOT</version>
8+
<version>0.18.3-SNAPSHOT</version>
99
</parent>
1010

1111

boat-scaffold/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.18.2-SNAPSHOT</version>
8+
<version>0.18.3-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>boat-scaffold</artifactId>
@@ -107,7 +107,7 @@
107107
<dependency>
108108
<groupId>com.backbase.oss</groupId>
109109
<artifactId>boat-trail-resources</artifactId>
110-
<version>0.18.2-SNAPSHOT</version>
110+
<version>0.18.3-SNAPSHOT</version>
111111
<scope>test</scope>
112112
</dependency>
113113
<dependency>

boat-trail-resources/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.18.2-SNAPSHOT</version>
8+
<version>0.18.3-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>boat-trail-resources</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.backbase.oss</groupId>
66
<artifactId>backbase-openapi-tools</artifactId>
7-
<version>0.18.2-SNAPSHOT</version>
7+
<version>0.18.3-SNAPSHOT</version>
88

99
<packaging>pom</packaging>
1010
<description>Backbase Open Api Tools is a collection of tools to work with Open API</description>

tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.18.2-SNAPSHOT</version>
8+
<version>0.18.3-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>tests</artifactId>

0 commit comments

Comments
 (0)