68
68
- id : project-version
69
69
name : Extract Project Version
70
70
run : echo "version=$(cat gradle.properties | grep 'version=' | awk -F'=' '{print $2}')" >> $GITHUB_OUTPUT
71
+ - id : next-snapshot-version
72
+ name : Calculate Next Snapshot Version
73
+ env :
74
+ VERSION : ${{ steps.project-version.outputs.version }}
75
+ run : echo "version=$(./gradlew -q getNextSnapshotVersion -PcurrentVersion=$VERSION)" >> $GITHUB_OUTPUT
76
+ - id : previous-release-milestone
77
+ name : Get Previous Release Milestone
78
+ env :
79
+ VERSION : ${{ steps.project-version.outputs.version }}
80
+ run : echo "version=$(./gradlew -q getPreviousReleaseMilestone -PcurrentVersion=$VERSION -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
81
+ - id : previous-snapshot-version
82
+ name : Get Previous Snapshot Version
83
+ env :
84
+ VERSION : ${{ steps.next-snapshot-version.outputs.version }}
85
+ run : echo "version=$(./gradlew -q getPreviousReleaseMilestone -PcurrentVersion=$VERSION -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
86
+ - id : next-release-milestone
87
+ name : Get Next Release Milestone
88
+ env :
89
+ VERSION : ${{ steps.next-snapshot-version.outputs.version }}
90
+ run : echo "version=$(./gradlew -q getNextReleaseMilestone -PcurrentVersion=$VERSION -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
91
+ - id : has-oss-support
92
+ name : Check OSS Support (for current branch)
93
+ run : echo "result=$(./gradlew -q checkBranchHasOssSupport -Pbranch=$BRANCH -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
71
94
- name : Wait for Milestone Artifacts
72
95
if : ${{ contains(steps.project-version.outputs.version, '-RC') || contains(steps.project-version.outputs.version, '-M') }}
73
96
env :
@@ -96,11 +119,22 @@ jobs:
96
119
env :
97
120
VERSION : ${{ steps.project-version.outputs.version }}
98
121
run : ./gradlew createGitHubRelease -PnextVersion=$VERSION -Pbranch=$BRANCH -PcreateRelease=true -PgitHubAccessToken=$TOKEN
99
- - id : previous-release-milestone
100
- name : Get Previous Release Milestone
122
+ - name : Update Version
123
+ env :
124
+ VERSION : ${{ steps.next-snapshot-version.outputs.version }}
125
+ run : |
126
+ sed -ie "s/^version=.*/version=$VERSION/" gradle.properties
127
+ git config user.name 'github-actions[bot]'
128
+ git config user.email 'github-actions[bot]@users.noreply.github.com'
129
+ git commit -am "Next development version"
130
+ git push
131
+ - name : Announce Release on GChat
101
132
env :
102
133
VERSION : ${{ steps.project-version.outputs.version }}
103
- run : echo "version=$(./gradlew -q getPreviousReleaseMilestone -PcurrentVersion=$VERSION -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
134
+ ANNOUNCING_ID : ${{ inputs.slack-announcing-id }}
135
+ WEBHOOK_URL : ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
136
+ run : |
137
+ curl -X POST '${{ env.WEBHOOK_URL }}' -H 'Content-Type: application/json' -d '{ "text": "${{ env.ANNOUNCING_ID }} `${{ env.VERSION }}` is available now" }' || true
104
138
- name : Delete Previous Version
105
139
if : ${{ steps.previous-release-milestone.outputs.version != '' }}
106
140
env :
@@ -114,48 +148,6 @@ jobs:
114
148
env :
115
149
VERSION : ${{ steps.project-version.outputs.version }}
116
150
run : ./gradlew closeMilestone -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
117
- - name : Announce Release on GChat
118
- env :
119
- VERSION : ${{ steps.project-version.outputs.version }}
120
- ANNOUNCING_ID : ${{ inputs.slack-announcing-id }}
121
- WEBHOOK_URL : ${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}
122
- run : |
123
- curl -X POST '${{ env.WEBHOOK_URL }}' -H 'Content-Type: application/json' -d '{ "text": "${{ env.ANNOUNCING_ID }} `${{ env.VERSION }}` is available now" }' || true
124
- next-development-version :
125
- name : Next Development Version
126
- runs-on : ubuntu-latest
127
- needs : [ perform-release ]
128
- env :
129
- BRANCH : ${{ github.ref_name }}
130
- TOKEN : ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
131
- steps :
132
- - uses : actions/checkout@v4
133
- with :
134
- token : ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
135
- - name : Set up JDK 17
136
- uses : spring-io/spring-gradle-build-action@v2
137
- - id : project-version
138
- name : Extract Project Version
139
- run : echo "version=$(cat gradle.properties | grep 'version=' | awk -F'=' '{print $2}')" >> $GITHUB_OUTPUT
140
- - id : next-snapshot-version
141
- name : Calculate Next Snapshot Version
142
- env :
143
- VERSION : ${{ steps.project-version.outputs.version }}
144
- run : echo "version=$(./gradlew -q getNextSnapshotVersion -PcurrentVersion=$VERSION)" >> $GITHUB_OUTPUT
145
- - name : Update Version
146
- env :
147
- VERSION : ${{ steps.next-snapshot-version.outputs.version }}
148
- run : |
149
- sed -ie "s/^version=.*/version=$VERSION/" gradle.properties
150
- git config user.name 'github-actions[bot]'
151
- git config user.email 'github-actions[bot]@users.noreply.github.com'
152
- git commit -am "Next development version"
153
- git push
154
- - id : previous-snapshot-version
155
- name : Get Previous Snapshot Version
156
- env :
157
- VERSION : ${{ steps.next-snapshot-version.outputs.version }}
158
- run : echo "version=$(./gradlew -q getPreviousReleaseMilestone -PcurrentVersion=$VERSION -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
159
151
- name : Delete Previous Snapshot Version
160
152
if : ${{ steps.previous-snapshot-version.outputs.version != '' }}
161
153
env :
@@ -165,14 +157,6 @@ jobs:
165
157
env :
166
158
VERSION : ${{ steps.next-snapshot-version.outputs.version }}
167
159
run : ./gradlew createSaganRelease -PnextVersion=$VERSION -PgitHubAccessToken=$TOKEN
168
- - id : next-release-milestone
169
- name : Get Next Release Milestone
170
- env :
171
- VERSION : ${{ steps.next-snapshot-version.outputs.version }}
172
- run : echo "version=$(./gradlew -q getNextReleaseMilestone -PcurrentVersion=$VERSION -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
173
- - id : has-oss-support
174
- name : Check OSS Support (for current branch)
175
- run : echo "result=$(./gradlew -q checkBranchHasOssSupport -Pbranch=$BRANCH -PgitHubAccessToken=$TOKEN)" >> $GITHUB_OUTPUT
176
160
- name : Schedule Next Release (if not already scheduled)
177
161
if : ${{ steps.has-oss-support.outputs.result == 'true' }}
178
162
env :
0 commit comments