From a7060f14ef755e43ac43d3f8e5e68f6a5c07cf84 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Mon, 5 Jun 2023 06:15:48 +0200 Subject: [PATCH 1/3] CI: Add semver checks to CI deploy job This will fail creating a new github release, if the semver action fails. This would have caught #841. --- .github/workflows/deploy.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 994ea3b8e..dd37c73ce 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,11 @@ on: jobs: linux-binaries: + permissions: + # Grant the GITHUB_TOKEN additional permissions necessary for creating a release. + # We only run this action for tags, so any code has already been reviewed by + # someone with permissions to create a tag. + contents: write runs-on: ubuntu-latest @@ -19,6 +24,11 @@ jobs: with: toolchain: stable + - name: semver + uses: obi1kenobi/cargo-semver-checks-action@v2 + with: + rust-toolchain: stable + - name: Build cbindgen run: | cargo build --release From 55747e163a7e429cb9f5477531c00ba83dec5fa8 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Thu, 22 Jun 2023 08:00:50 +0800 Subject: [PATCH 2/3] CI: Replace forbidden actions with cli code the semver checks action and the release action are not in the allow-list so replace them with their respective cli counterparts. These changes can only be tested by someone with permissions, so the release part only releases a draft release for now. --- .github/workflows/deploy.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dd37c73ce..96f31866b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: # someone with permissions to create a tag. contents: write - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -25,9 +25,9 @@ jobs: toolchain: stable - name: semver - uses: obi1kenobi/cargo-semver-checks-action@v2 - with: - rust-toolchain: stable + run: | + cargo install cargo-semver-checks --locked + cargo semver-checks check-release - name: Build cbindgen run: | @@ -51,11 +51,8 @@ jobs: sed '$ d' | awk '{$1=$1};1' > CHANGES.txt - name: Create a release - uses: softprops/action-gh-release@v1 - with: - name: v${{ steps.tagName.outputs.version }} - body_path: CHANGES.txt - files: | - target/release/cbindgen + run: | + TAG=${{ steps.tagName.outputs.version }} + gh release create ${TAG} --title "${TAG}" --notes-file "CHANGES.txt" --draft 'target/release/cbindgen#cbindgen-ubuntu20.04' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2875f7f19337cca56e173a5b7fe1b4eb0c2e53f4 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Thu, 22 Jun 2023 11:02:49 +0800 Subject: [PATCH 3/3] Update changelog for v0.25.0 --- CHANGES | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGES b/CHANGES index c19d62a78..c68796a75 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ +## 0.25.0 + + * Re-release of yanked 0.24.6 as a major release + * Update MSRV to 1.57 + * Support variadic arguments (`...`) (#805) + * Add --depfile option (#820) + * Breaking changes: The `Config` struct now has a private member. + ## 0.24.6 (YANKED: depfile option was breaking, see #841) * Update MSRV to 1.57