ci(release): use env-mapped token guard for crates.io publish step

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
infosave2007
2026-06-30 13:54:35 +03:00
co-authored by Claude Opus 4.8
parent e97fcddf87
commit 73a2bd7b42
+5 -3
View File
@@ -14,14 +14,16 @@ jobs:
# --- publish to crates.io -------------------------------------------------
crates-io:
runs-on: ubuntu-latest
# Requires a CARGO_REGISTRY_TOKEN repo secret (Settings → Secrets → Actions).
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Publish to crates.io
# Requires a CARGO_REGISTRY_TOKEN repo secret (Settings → Secrets → Actions).
if: ${{ secrets.CARGO_REGISTRY_TOKEN != '' }}
run: cargo publish --token "${{ secrets.CARGO_REGISTRY_TOKEN }}"
if: ${{ env.CARGO_REGISTRY_TOKEN != '' }}
run: cargo publish
# --- prebuilt binaries + GitHub Release -----------------------------------
release: