From abdc967c99c6be79f78b56891554b657a810be4d Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 8 Jul 2026 20:32:51 -0400 Subject: [PATCH] Setup separate rustworkx-core publish job with trusted publishers (#1630) This commit splits out the release publish job for the rustworkx-core crate to crates.io from the wheels file into a separate job workflow file. This then lets us setup the cargo publish job to use the trusted publishers mechanism instead of a secret token for authentication which is more secure. The docs for using trusted publisher are located here: https://crates.io/docs/trusted-publishing the new cargo_publish workflow's job is updated to more closely follow the example in the docs. I've already updated the crate's configuration on crates.io to use cargo_publish.yml for the trusted publisher mechanism. (cherry picked from commit 70a4530acdac0f8c0bd32d86e5b005d20faab1cd) --- .github/workflows/cargo_publish.yml | 23 +++++++++++++++++++++++ .github/workflows/wheels.yml | 12 ------------ 2 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/cargo_publish.yml diff --git a/.github/workflows/cargo_publish.yml b/.github/workflows/cargo_publish.yml new file mode 100644 index 0000000000..9c62efb6a7 --- /dev/null +++ b/.github/workflows/cargo_publish.yml @@ -0,0 +1,23 @@ +--- +name: Publish rustworkx-core to crates.io +on: + push: + tags: + - '*' +jobs: + rustworkx-core: + name: Publish rustworkx-core + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - uses: actions/checkout@v6 + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + - name: Run cargo publish + run: | + cd rustworkx-core + cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e002591ae8..fce4995501 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -5,18 +5,6 @@ on: tags: - '*' jobs: - rustworkx-core: - name: Publish rustworkx-core - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - name: Run cargo publish - run: | - cd rustworkx-core - cargo publish - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} sdist: name: Build sdist runs-on: ubuntu-latest