diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fea824ccc2..972cadede8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,6 +33,9 @@ jobs: publish: runs-on: ubuntu-latest environment: publish + permissions: + contents: read + id-token: write # Required for crates.io trusted publishing steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -47,13 +50,16 @@ jobs: with: rust-version: ${{ steps.get-msrv.outputs.msrv }} + - uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1 + id: auth + - name: Publish crates # Only publish if it's a tag and the tag is not a pre-release if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-') }} - run: cargo publish --workspace --all-features # zizmor: ignore[use-trusted-publishing] -- https://github.com/apache/iceberg-rust/issues/1539 + run: cargo publish --workspace --all-features shell: bash env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} # Trigger Python release after crate publishing completes. # Only runs for tag pushes; for manual Python releases, use workflow_dispatch on release_python.yml directly.