From 103fd6c9f7ce425f9be3f9639cc69c2a13927ecb Mon Sep 17 00:00:00 2001 From: Moritz Althaus Date: Mon, 21 Oct 2024 17:30:08 +0200 Subject: [PATCH] ci: add release-please action --- .github/workflows/release-please.yml | 23 +++++++++++++++++++++++ .github/workflows/release.yml | 22 ---------------------- .release-please-manifest.json | 1 + release-please-config.json | 10 ++++++++++ 4 files changed, 34 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/release-please.yml delete mode 100644 .github/workflows/release.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..c7a024b --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,23 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + - if: ${{ steps.release.outputs.release_created }} + steps: + - uses: actions/checkout@v4 + - name: Publish to cargo + env: + CARGO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} + run: cargo publish --token "${CARGO_TOKEN}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index c31008b..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Release - -on: - push: - # Sequence of patterns matched against refs/tags - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - -jobs: - ubuntu: - name: Release to crates.io - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Publish to cargo - env: - CARGO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - run: | - cargo publish --token "${CARGO_TOKEN}" \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..6e7427c --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,10 @@ +{ + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "last-release-sha": "74c5ca507db8cb62e506600b8f4b41b2223c745a", + "packages": { + ".": { + "release-type": "rust" + } + } +} \ No newline at end of file