Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,23 @@ jobs:
echo "present=true" >> "${GITHUB_OUTPUT}"
fi

- name: Check Crates.io Version
id: crate
shell: bash
run: |
VERSION="${{ needs.resolve-tag.outputs.clean_version }}"
CRATE="slotstrike"
META_URL="https://crates.io/api/v1/crates/${CRATE}"

if curl --fail --silent "${META_URL}" | grep -q "\"num\":\"${VERSION}\""; then
echo "exists=true" >> "${GITHUB_OUTPUT}"
echo "${CRATE} ${VERSION} already exists on crates.io. Skipping publish." >> "${GITHUB_STEP_SUMMARY}"
else
echo "exists=false" >> "${GITHUB_OUTPUT}"
fi

- name: Publish to Cargo
if: steps.token.outputs.present == 'true'
if: steps.token.outputs.present == 'true' && steps.crate.outputs.exists != 'true'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --locked
Expand All @@ -250,7 +265,7 @@ jobs:
target: x86_64-pc-windows-msvc
suffix: windows-x86_64
archive: zip
- os: macos-13
- os: macos-15-intel
target: x86_64-apple-darwin
suffix: macos-x86_64
archive: tar.gz
Expand Down