We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8285593 commit 0c1f783Copy full SHA for 0c1f783
1 file changed
.github/workflows/publish-crate.yml
@@ -13,6 +13,8 @@ jobs:
13
publish:
14
name: Publish to crates.io
15
runs-on: ubuntu-latest
16
+ env:
17
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
18
steps:
19
- uses: actions/checkout@v4
20
- uses: dtolnay/rust-toolchain@stable
@@ -21,7 +23,9 @@ jobs:
21
23
cargo fmt --check
22
24
cargo clippy --all-targets --all-features -- -D warnings
25
cargo test --all-features
- - name: Publish
- env:
26
- CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
+ - name: Publish to crates.io
27
+ if: env.CARGO_REGISTRY_TOKEN != ''
28
run: cargo publish
29
+ - name: Skip publish (no token configured)
30
+ if: env.CARGO_REGISTRY_TOKEN == ''
31
+ run: echo "::warning::CARGO_REGISTRY_TOKEN secret is not set; skipping crates.io publish. Add it under repo Settings > Secrets and re-run."
0 commit comments