From 76d396f00b7239a59413718b6400459d27289c2f Mon Sep 17 00:00:00 2001 From: phact Date: Tue, 7 Oct 2025 12:47:50 -0400 Subject: [PATCH] only release on tag change --- .github/workflows/build-multiarch.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index e05d2330..3c5a3aa9 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -30,6 +30,14 @@ jobs: echo "version=$VERSION" >> $GITHUB_OUTPUT echo "Version: $VERSION" + # Check if tag already exists + if git rev-parse "v$VERSION" >/dev/null 2>&1; then + echo "Tag v$VERSION already exists, skipping release" + echo "skip_release=true" >> $GITHUB_OUTPUT + exit 0 + fi + echo "skip_release=false" >> $GITHUB_OUTPUT + # Check if version is numeric (e.g., 0.1.16) vs prerelease (e.g., 0.1.16-rc1) if [[ "$VERSION" =~ ^[0-9.-]+$ ]]; then echo "is_prerelease=false" >> $GITHUB_OUTPUT @@ -40,10 +48,12 @@ jobs: fi - name: Build wheel and source distribution + if: steps.version.outputs.skip_release != 'true' run: | uv build - name: List built artifacts + if: steps.version.outputs.skip_release != 'true' run: | ls -la dist/ echo "Built artifacts:" @@ -52,6 +62,7 @@ jobs: done - name: Upload build artifacts + if: steps.version.outputs.skip_release != 'true' uses: actions/upload-artifact@v4 with: name: python-packages @@ -59,6 +70,7 @@ jobs: retention-days: 30 - name: Create Release + if: steps.version.outputs.skip_release != 'true' uses: softprops/action-gh-release@v2 with: tag_name: v${{ steps.version.outputs.version }}