test: use git describe

This commit is contained in:
Skillz4Killz
2022-02-25 18:49:06 +00:00
committed by GitHub
parent b89ee18930
commit a0e6a7e9c3
+3 -5
View File
@@ -16,13 +16,11 @@ jobs:
- uses: denoland/setup-deno@main
with:
deno-version: ${{ matrix.deno }}
# Taken from: https://github.com/denoland/dnt#github-actions---npm-publish-on-tag
- name: Get tag version
id: get_tag_version
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
- name: Get last tag version
run: echo "DISCORDENO_VERSION_OLD=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Get new tag version
run: echo "DISCORDENO_VERSION=$(cat util/constants.ts | grep 'export const DISCORDENO_VERSION' | awk -F'= ' '{print $2}' | tr -d '"|;')" >> $GITHUB_ENV
- name: Create tag
if: ${{ env.DISCORDENO_VERSION != steps.get_tag_version.outputs.TAG_VERSION }}
if: ${{ env.DISCORDENO_VERSION != env.DISCORDENO_VERSION_OLD }}
run: git tag ${{ env.DISCORDENO_VERSION }} && git push --tags