Skip to content

Commit 402d6b5

Browse files
authored
fix: #dev-deploy tag fix 7
1 parent a8a785e commit 402d6b5

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,24 +191,28 @@ jobs:
191191
name: Create tag
192192
runs-on: self-hosted
193193
steps:
194-
- name: Set Dist Version
194+
- name: Determine new tag
195+
id: tag
195196
run: |
196-
BUILD_NUMBER="${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"
197-
echo "${BUILD_NUMBER}"
198-
VERSION=$(echo $last_tag | awk -F. '{printf "v%d.%d.%d", $1, $2+1, 0}')
199-
echo "DIST_VERSION=${VERSION}" >> $GITHUB_ENV
197+
last_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
198+
echo "Last tag: $last_tag"
200199
201-
- name: Create Tag
202-
uses: actions/github-script@v6
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
203207
with:
204208
script: |
205-
const {DIST_VERSION} = process.env
206209
github.rest.git.createRef({
207-
owner: context.repo.owner,
208-
repo: context.repo.repo,
209-
ref: `refs/tags/${DIST_VERSION}`,
210-
sha: context.sha
211-
})
210+
owner: context.repo.owner,
211+
repo: context.repo.repo,
212+
ref: `refs/tags/${{ env.TAG_NAME }}`,
213+
sha: context.sha
214+
});
215+
212216
213217
214218

0 commit comments

Comments
 (0)