Skip to content

Commit

Permalink
gha: rust: publish crate from github action
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksa Sarai <[email protected]>
  • Loading branch information
cyphar committed Oct 9, 2024
1 parent e8d76a4 commit 0cd536d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,23 @@ jobs:
components: clippy
- run: cargo clippy --all-features --all-targets

release-crate:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
name: release-crate
url: "https://crates.io/crates/pathrs"
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

complete:
if: ${{ ! failure() && ! cancelled() }}
needs:
- check
- check-msrv
Expand All @@ -136,6 +152,7 @@ jobs:
- examples
- fmt
- clippy
- release-crate
runs-on: ubuntu-latest
steps:
- run: echo "Rust CI jobs completed successfully."

0 comments on commit 0cd536d

Please sign in to comment.