From 08bbfcdb0e5651e40ca3be4891ee5fe706b98fb2 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Fri, 31 Oct 2025 23:37:55 +0300 Subject: [PATCH 1/4] ci: tweak release workflow --- .github/workflows/release.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4721ba5f..c9ec9eca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,21 +2,11 @@ name: Publish to crates.io and create GitHub release on: push: tags: ['v*'] + pull_request: + branches: 'master' jobs: - # Source: https://crates.io/docs/trusted-publishing - publish: - runs-on: ubuntu-latest - environment: release # Optional: for enhanced security - permissions: - id-token: write # Required for OIDC token exchange - steps: - - uses: actions/checkout@v5 - - uses: rust-lang/crates-io-auth-action@v1 - id: auth - - run: cargo publish - env: - CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + # Source: https://medium.com/@usman_qb release: From fb6b8e6de51eb48e9f123428c4494c3a9b7ff06c Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Fri, 31 Oct 2025 23:39:07 +0300 Subject: [PATCH 2/4] update --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9ec9eca..1d35a748 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,12 +6,12 @@ on: branches: 'master' jobs: - - # Source: https://medium.com/@usman_qb release: runs-on: ubuntu-latest steps: + - run: ls + - run: cat CHANGELOG.md - name: Create release body id: create_release_body run: | From de65b483838d13fb33b9a9b6612a7db8d5d15425 Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Fri, 31 Oct 2025 23:41:05 +0300 Subject: [PATCH 3/4] update --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d35a748..9c693fb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ jobs: release: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v5 - run: ls - run: cat CHANGELOG.md - name: Create release body From 34a85c8edcc6830befab3af59a99c6823bbcf0ba Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Fri, 31 Oct 2025 23:43:43 +0300 Subject: [PATCH 4/4] Fix release workflow --- .github/workflows/release.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c693fb6..b5a8b445 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,18 +2,28 @@ name: Publish to crates.io and create GitHub release on: push: tags: ['v*'] - pull_request: - branches: 'master' jobs: + # Source: https://crates.io/docs/trusted-publishing + publish: + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - uses: actions/checkout@v5 + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + - run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} + # Source: https://medium.com/@usman_qb release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - - run: ls - - run: cat CHANGELOG.md - - name: Create release body + - name: Generate release body id: create_release_body run: | RELEASE_VERSION="${{ github.ref_name }}" @@ -24,7 +34,6 @@ jobs: echo "${RELEASE_BODY}" echo EOF } >> $GITHUB_OUTPUT - - name: Create GitHub release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}