From 3ad6f0f4d757cc48ad40ebacd37b61b0000846b9 Mon Sep 17 00:00:00 2001 From: drbh Date: Sat, 11 Oct 2025 11:42:54 +0100 Subject: [PATCH 1/3] feat: manual release workflow --- .github/workflows/release.yml | 70 +++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..b5dd1a7267 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,70 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g., 0.9.2)' + required: true + type: string + +permissions: + contents: write + pull-requests: read + +jobs: + verify-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Check version matches input + run: | + CURRENT_VERSION=$(grep -A1 "^\[workspace\.package\]" Cargo.toml | grep "version" | sed 's/.*= "\(.*\)"/\1/') + if [ "$CURRENT_VERSION" != "${{ github.event.inputs.version }}" ]; then + echo "Version mismatch: Cargo.toml has $CURRENT_VERSION but input is ${{ github.event.inputs.version }}" + exit 1 + fi + echo "Version $CURRENT_VERSION matches input" + + run-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + + - name: Run tests + run: cargo test --workspace + + - name: Check examples compile + run: cargo check --examples + + create-release: + needs: [verify-version, run-tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ github.event.inputs.version }} + release_name: Release v${{ github.event.inputs.version }} + body: Release v${{ github.event.inputs.version }} + draft: false + prerelease: false + + publish-crates: + needs: [create-release] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + + - name: Publish all crates + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + cargo workspaces publish --from-git --yes --token $CARGO_REGISTRY_TOKEN \ No newline at end of file From 0dabf5e96f376428ca69dbf24247ac7c166c614a Mon Sep 17 00:00:00 2001 From: drbh Date: Wed, 22 Oct 2025 14:00:25 -0400 Subject: [PATCH 2/3] fix: prefer gh release action --- .github/workflows/release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5dd1a7267..46025a34a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,12 +46,10 @@ jobs: - uses: actions/checkout@v4 - name: Create Release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: tag_name: v${{ github.event.inputs.version }} - release_name: Release v${{ github.event.inputs.version }} + name: Release v${{ github.event.inputs.version }} body: Release v${{ github.event.inputs.version }} draft: false prerelease: false From 820acf0d65cff3a5e49f7b73eae2e807632320ab Mon Sep 17 00:00:00 2001 From: drbh Date: Wed, 22 Oct 2025 18:27:27 -0400 Subject: [PATCH 3/3] fix: add cargo workspace tooling --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46025a34a5..dec1719890 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,8 +61,17 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable + # helper tool to publish all workspace crates in correct order + - name: Install cargo-workspaces + run: cargo install cargo-workspaces + - name: Publish all crates env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: | - cargo workspaces publish --from-git --yes --token $CARGO_REGISTRY_TOKEN \ No newline at end of file + # flags: + # --from-git: uses git source to determine versions + # --no-verify: because `bert-single-file-binary-builder` modifies files during build.rs + # --yes: skip confirmation prompt + # --token: use the provided token for authentication + run: | + cargo workspaces publish --from-git --no-verify --yes --token $CARGO_REGISTRY_TOKEN \ No newline at end of file