| # Publish the clippy_utils crate to crates.io | |
| name: Publish crates.io crates | |
| on: | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| publish: | |
| name: Publish | |
| runs-on: ubuntu-latest | |
| environment: publish | |
| permissions: | |
| id-token: write # Required by `rust-lang/crates-io-auth-action` to fetch an OIDC token | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Install toolchain | |
| run: rustup toolchain install | |
| - uses: rust-lang/crates-io-auth-action@3268eb413133e2960fa4ae0e963ca76380c54cd9 # v1.0.6 | |
| id: auth | |
| - run: | | |
| cd clippy_utils | |
| cargo publish | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |