diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e30b0ce..c02dfc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -275,7 +275,14 @@ jobs: fi - name: Publish - if: steps.check.outputs.skip == 'false' && github.ref == 'refs/heads/master' - run: cargo publish + if: steps.check.outputs.skip == 'false' + run: | + cargo publish 2>&1 | tee publish_output.txt || { + if grep -q "already uploaded" publish_output.txt; then + echo "Version already published, skipping" + exit 0 + fi + exit 1 + } env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}