@@ -191,27 +191,24 @@ jobs:
191
191
name: Create tag
192
192
runs-on: self-hosted
193
193
steps:
194
- - name: Determine new tag
195
- id: tag
194
+ - name: Set Dist Version
196
195
run: |
197
- last_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
198
- echo "Last tag: $last_tag"
196
+ BUILD_NUMBER="${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"
197
+ echo "${BUILD_NUMBER}"
198
+ VERSION="$(mvn -q -U -Dexpression=project.build.finalName help:evaluate -DforceStdout=true -DbuildNumber=${BUILD_NUMBER})"
199
+ echo "DIST_VERSION=${VERSION}" >> $GITHUB_ENV
199
200
200
- new_tag=$(echo $last_tag | awk -F. '{printf "v%d.%d.%d", $1, $2+1, 0}')
201
- echo "New tag: $new_tag"
202
-
203
- echo "TAG_NAME=$new_tag" >> $GITHUB_ENV
204
-
205
- - name: Create tag
206
- uses: actions/github-script@v5
201
+ - name: Create Tag
202
+ uses: actions/github-script@v6
207
203
with:
208
204
script: |
205
+ const {DIST_VERSION} = process.env
209
206
github.rest.git.createRef({
210
- owner: context.repo.owner,
211
- repo: context.repo.repo,
212
- ref: `refs/tags/${{ env.TAG_NAME } }`,
213
- sha: context.sha
214
- });
207
+ owner: context.repo.owner,
208
+ repo: context.repo.repo,
209
+ ref: `refs/tags/${DIST_VERSION }`,
210
+ sha: context.sha
211
+ })
215
212
216
213
217
214
0 commit comments