Skip to content

Commit

Permalink
ci: Publish to crates.io upon release (#152)
Browse files Browse the repository at this point in the history
Signed-off-by: Thane Thomson <[email protected]>
  • Loading branch information
thanethomson authored Dec 5, 2023
1 parent 5bd3422 commit d21dad5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# Runs one last test prior to attempting to publish the crate to crates.io. If
# the crate is published successfully, it creates a release and builds binaries
# for macOS, Windows and Linux and attaches the binaries to the release.
name: Release
on:
push:
tags:
- v[0-9]+.*

jobs:
publish-to-cratesio:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@stable
# Last check prior to publishing
- run: cargo test --all-features
- run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}

create-release:
needs: publish-to-cratesio
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -16,6 +31,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

upload-assets:
needs: publish-to-cratesio
strategy:
matrix:
os:
Expand Down

0 comments on commit d21dad5

Please sign in to comment.