From f02494f8e47c88ab3df4398eade91e2704ab735f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 2 Jul 2026 22:17:50 +0200 Subject: [PATCH 1/3] Configure trusted publishing via release-plz --- .github/workflows/publish.yml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e6909f4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,52 @@ +name: Release-plz + +on: + push: + branches: + - main + +jobs: + # Release unpublished packages. + release-plz-release: + name: Release-plz release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: read + id-token: write + steps: + - &checkout + name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + persist-credentials: false + - &install-rust + name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: release-plz/action@e8792575c7f2366cf6ff3ccc33ead9ace5b691c7 # v0.5 + with: + command: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Create a PR with the new versions and changelog, preparing the next release. + release-plz-pr: + name: Release-plz PR + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + concurrency: + group: release-plz-${{ github.ref }} + cancel-in-progress: false + steps: + - *checkout + - *install-rust + - name: Run release-plz + uses: release-plz/action@e8792575c7f2366cf6ff3ccc33ead9ace5b691c7 # v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 64e8526fd0d9248f331f29fd25125faf139ad380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 3 Jul 2026 09:54:18 +0200 Subject: [PATCH 2/3] Add publish environment --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e6909f4..06120f1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,6 +10,7 @@ jobs: release-plz-release: name: Release-plz release runs-on: ubuntu-latest + environment: publish permissions: contents: write pull-requests: read From eec321339236d506636a9276a19af0391e175eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 3 Jul 2026 10:03:12 +0200 Subject: [PATCH 3/3] Check GitHub org to avoid failing on forks Co-authored-by: Marco Ieni <11428655+marcoieni@users.noreply.github.com> --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 06120f1..5d35ed3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,7 @@ jobs: # Release unpublished packages. release-plz-release: name: Release-plz release + if: ${{ github.repository_owner == 'rust-lang' }} runs-on: ubuntu-latest environment: publish permissions: @@ -35,6 +36,7 @@ jobs: # Create a PR with the new versions and changelog, preparing the next release. release-plz-pr: name: Release-plz PR + if: ${{ github.repository_owner == 'rust-lang' }} runs-on: ubuntu-latest permissions: contents: write