From a0e6a7e9c3c0183b17ea5438b651e6f8d8c0b2fe Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Fri, 25 Feb 2022 18:49:06 +0000 Subject: [PATCH] test: use git describe --- .github/workflows/release.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f8deace5..eec54380f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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