feat: enhance publish step to handle already uploaded versions
This commit is contained in:
@@ -275,7 +275,14 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
if: steps.check.outputs.skip == 'false' && github.ref == 'refs/heads/master'
|
if: steps.check.outputs.skip == 'false'
|
||||||
run: cargo publish
|
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:
|
env:
|
||||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||||
|
|||||||
Reference in New Issue
Block a user