Skip to content

Commit 817898b

Browse files
authored
Merge pull request #101 from ruromero/fix/release-version
fix: invalid version bump and body generation
2 parents 9d85efb + f62a400 commit 817898b

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

.github/workflows/release.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ jobs:
4646
else
4747
mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false
4848
fi
49-
mvn -B release:update-versions
5049
mvn -B process-resources
5150
mvn -B validate
5251
@@ -57,13 +56,15 @@ jobs:
5756
echo "version=$V" >> $GITHUB_OUTPUT
5857
5958
- name: Create release branch
59+
id: release_branch
6060
run: |
6161
BRANCH="release/v${{ steps.version.outputs.version }}"
6262
git config user.name "${{ github.actor }}"
6363
git config user.email "${{ github.actor }}@users.noreply.github.com"
6464
git checkout -b "$BRANCH"
6565
git add -A
6666
git commit -m "build(release): release version ${{ steps.version.outputs.version }}"
67+
echo "release_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
6768
# Force-push so we overwrite any existing release branch (e.g. from a previous run)
6869
git push --force origin "$BRANCH"
6970
echo "$BRANCH" > releasebranch.txt
@@ -78,25 +79,30 @@ jobs:
7879
with:
7980
name: "Release ${{ steps.version.outputs.version }}"
8081
tag_name: "v${{ steps.version.outputs.version }}"
81-
target_commitish: "release/v${{ steps.version.outputs.version }}"
82+
target_commitish: ${{ steps.release_branch.outputs.release_sha }}
8283
generate_release_notes: true
8384
env:
8485
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8586

86-
- name: Create Pull Request for release + next version
87+
- name: Bump to next development version
8788
run: |
88-
BODY=$(cat <<- EOF
89+
mvn -B release:update-versions -DgenerateBackupPoms=false
90+
git add -A
91+
git commit -m "build(release): bump to next development version"
92+
git push origin "release/v${{ steps.version.outputs.version }}"
93+
94+
- name: Create Pull Request for release + next version
95+
env:
96+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
PR_BODY: |
8998
This PR contains the following changes:
9099
91100
1. Release version bump to ${{ steps.version.outputs.version }}.
92101
2. Filtered resources (docs, JS) updated to reflect the release version.
93102
3. Next development version bump after the release.
94-
EOF
95-
)
103+
run: |
96104
gh pr create \
97105
--title "build(release): release ${{ steps.version.outputs.version }} and bump to next development version" \
98-
--body "$BODY" \
106+
--body "$PR_BODY" \
99107
--base main \
100108
--head "release/v${{ steps.version.outputs.version }}"
101-
env:
102-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)