Skip to content

Commit 596b9e5

Browse files
authored
fix: #dev-deploy tag fix 5
1 parent 81885d3 commit 596b9e5

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

.github/workflows/dev.kodemy.deploy.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,24 @@ jobs:
191191
name: Create tag
192192
runs-on: self-hosted
193193
steps:
194-
- name: Determine new tag
195-
id: tag
194+
- name: Set Dist Version
196195
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
199200

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
207203
with:
208204
script: |
205+
const {DIST_VERSION} = process.env
209206
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+
})
215212

216213

217214

0 commit comments

Comments
 (0)