From fe6d409fb52223856d7dd04db6ed9adaf99aa339 Mon Sep 17 00:00:00 2001 From: Nix <75538775+nixietab@users.noreply.github.com> Date: Tue, 31 Dec 2024 11:45:14 -0300 Subject: [PATCH] Update Build.yml --- .github/workflows/Build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index fae3e2c..86d4cc5 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -38,14 +38,17 @@ jobs: - name: Read version and name from version.json id: version run: | - $VERSION = (jq -r '.version' version.json) - $NAME = (jq -r '.name' version.json) + VERSION=$(jq -r '.version' version.json) + NAME=$(jq -r '.name' version.json) echo "VERSION=$VERSION" >> $GITHUB_ENV # Store version in the environment variable echo "NAME=$NAME" >> $GITHUB_ENV # Store name in the environment variable - name: Check if tag exists run: | - git tag # List the tags in the repository to check if the tag exists + if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then + echo "Tag v${{ env.VERSION }} already exists, skipping tag creation." + exit 0 + fi - name: Tag release run: | @@ -60,7 +63,6 @@ jobs: git tag -a "v${{ env.VERSION }}" -m "Release ${{ env.VERSION }} ${{ env.NAME }}" # Tag the release git push origin --tags # Push all tags to GitHub - - name: Create Release uses: softprops/action-gh-release@v1 with: