Skip to content

Commit

Permalink
del: check for published crate
Browse files Browse the repository at this point in the history
  • Loading branch information
KjetilIN committed May 27, 2024
1 parent 84c70c9 commit 49fa904
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,7 @@ jobs:
toolchain: stable
override: true

- name: Check if Crate.io version is already published
id: check_version
run: |
version=$(grep '^version =' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
if cargo search $(basename $(pwd)) --limit 1 | grep -q "${version}"; then
echo "Version ${version} is already published"
echo "publish_needed=false" >> $GITHUB_ENV
else
echo "publish_needed=true" >> $GITHUB_ENV
- name: Publish to Crates.io
if: env.publish_needed == 'true'
run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
Expand Down

0 comments on commit 49fa904

Please sign in to comment.