From 71241a6cd23c6a75a09a6d4fcf7a05f12fe4615f Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Fri, 2 Aug 2024 14:15:32 +0900 Subject: [PATCH] Add release workflow --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 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 0000000..93bfc6b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + tags: + - "*" + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: cargo publish + run: | + cargo publish -p pyo3-stub-gen-derive + cargo publish -p pyo3-stub-gen + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + next_version: + runs-on: ubuntu-latest + needs: publish + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install cargo-edit + run: cargo install cargo-edit + + - name: Bump version + run: | + cargo set-version --bump patch + echo "NEW_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version')" >> $GITHUB_ENV + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + title: "Start developing ${{ env.NEW_VERSION }}" + branch: "rust-version-update/${{ env.NEW_VERSION }}" + base: "main"