2 Commits
Author SHA1 Message Date
chrnx 69942ce540 Merge pull request 'ci: crates.io Trusted Publishing (OIDC, no token)' (#6) from ci/trusted-publishing into develop
CI / check (push) Successful in 28s
CI / check (pull_request) Successful in 27s
2026-07-18 20:18:12 +00:00
chrnx a273c249c3 ci: publish to crates.io via OIDC Trusted Publishing (no token)
CI / check (pull_request) Successful in 27s
Replaces CARGO_TOKEN with crates.io Trusted Publishing: id-token: write + rust-lang/crates-io-auth-action exchanges the OIDC token for a short-lived crates.io token. Requires a trusted publisher configured on crates.io (Expressive-Tea/matcha, release.yml).

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-18 14:54:25 -05:00
+8 -1
View File
@@ -83,16 +83,23 @@ jobs:
matcha-${{ matrix.target }}.tar.gz.sha256 matcha-${{ matrix.target }}.tar.gz.sha256
# crates.io = production only. # crates.io = production only.
# crates.io = production only, via OIDC Trusted Publishing (no CARGO_TOKEN).
# Requires a trusted publisher configured on crates.io (Expressive-Tea/matcha, release.yml).
publish-crate: publish-crate:
if: ${{ github.server_url == 'https://github.com' }} if: ${{ github.server_url == 'https://github.com' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
id-token: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Rust - name: Install Rust
run: | run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
# Exchanges the OIDC id-token for a short-lived crates.io token.
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- name: cargo publish - name: cargo publish
env: env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish --locked run: cargo publish --locked