Skip to content

Commit 02a1b33

Browse files
author
Fabiana Severin
committed
fix: Correct pom versioning and release workflow
1 parent f04a930 commit 02a1b33

4 files changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ on:
3434
default: false
3535

3636
permissions:
37-
contents: write
38-
id-token: write
37+
contents: write # push the release tag and the version-bump branch
38+
id-token: write # OIDC for the Maven Central release role
39+
pull-requests: write # open the post-release version-bump PR into main
3940

4041
# Serialize all releases repo-wide to avoid concurrent pushes racing on the
4142
# default branch. Never cancel in-flight: it could leave a half-published state.
@@ -251,10 +252,26 @@ jobs:
251252
-Darguments="-gs $MAVEN_SETTINGS -Prelease -Dgpg.keyname=$GPG_KEYNAME -Dgpg.passphrase=$GPG_PASSPHRASE" \
252253
--file "$MODULE/pom.xml"
253254
254-
# Push commits + tag atomically, only after publish succeeded.
255-
git push --atomic origin \
256-
"HEAD:${GITHUB_REF_NAME}" \
257-
"refs/tags/${MODULE}-${EFFECTIVE_RELEASE_VERSION}"
255+
# main is protected (no direct push), so push the tag and open a PR for
256+
# the version-bump commits instead. Skipping this would leave the POM on
257+
# the just-released -SNAPSHOT.
258+
- name: Push release tag and open version-bump PR
259+
if: ${{ github.event.inputs.skip_publish != 'true' }}
260+
env:
261+
GH_TOKEN: ${{ github.token }}
262+
run: |
263+
TAG="${MODULE}-${EFFECTIVE_RELEASE_VERSION}"
264+
RELEASE_BRANCH="release/${TAG}"
265+
266+
# Tag push isn't gated by branch protection; commits go via a PR.
267+
git push origin "refs/tags/${TAG}"
268+
git push origin "HEAD:refs/heads/${RELEASE_BRANCH}"
269+
270+
gh pr create \
271+
--base "${GITHUB_REF_NAME}" \
272+
--head "${RELEASE_BRANCH}" \
273+
--title "chore(release): ${MODULE} ${EFFECTIVE_RELEASE_VERSION}" \
274+
--body "Post-release version bump for ${MODULE} ${EFFECTIVE_RELEASE_VERSION} (already on Maven Central, tag ${TAG} pushed)."
258275
259276
- name: Dry-run release (prepare only, no publish)
260277
if: ${{ github.event.inputs.skip_publish == 'true' }}

aws-lambda-java-core/pom.xml

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

66
<groupId>com.amazonaws</groupId>
77
<artifactId>aws-lambda-java-core</artifactId>
8-
<version>1.4.0-SNAPSHOT</version>
8+
<version>1.4.1-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010

1111
<name>AWS Lambda Java Core Library</name>

aws-lambda-java-events-sdk-transformer/pom.xml

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

66
<groupId>com.amazonaws</groupId>
77
<artifactId>aws-lambda-java-events-sdk-transformer</artifactId>
8-
<version>3.1.1-SNAPSHOT</version>
8+
<version>3.1.2-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010

1111
<name>AWS Lambda Java Events SDK Transformer Library</name>

aws-lambda-java-events/pom.xml

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

66
<groupId>com.amazonaws</groupId>
77
<artifactId>aws-lambda-java-events</artifactId>
8-
<version>3.16.1-SNAPSHOT</version>
8+
<version>3.16.2-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010

1111
<name>AWS Lambda Java Events Library</name>

0 commit comments

Comments
 (0)