From 4725a36efd16daa36b9cd29ab72caafed48d1940 Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 15 May 2025 23:29:36 +0800 Subject: [PATCH] ci: enable release-plz workflow for automation release close #15 --- .github/workflows/release-plz.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/release.yml | 25 ------------------------- cliff.toml | 15 +++++++++++++++ example/Cargo.toml | 1 + release-plz.toml | 4 ++++ 5 files changed, 51 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/release-plz.yml delete mode 100644 .github/workflows/release.yml create mode 100644 cliff.toml create mode 100644 release-plz.toml diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 0000000..487bbdb --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,31 @@ +name: Release Plz + +permissions: {} + +on: + workflow_dispatch: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + release-plz: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Run release-plz + id: release-plz + uses: release-plz/action@bbd1afc9813d25602e002b29e96e0aacebab1160 # v0.5.105 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 17e4e92..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release - -on: - push: - tags: - - v* - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - - name: cargo login - run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }} - - name: Run publish - working-directory: libmimalloc-sys - run: cargo publish - - name: Run publish - run: cargo publish \ No newline at end of file diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..80be251 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,15 @@ +# git-cliff ~ configuration file +# https://git-cliff.org/docs/configuration + +[git] +commit_parsers = [ + { message = "^doc", group = "Documentation" }, + { message = "^feat", group = "Features" }, + { message = "^fix", group = "Bug Fixes" }, + { message = "^perf", group = "Performance" }, + { message = "^refactor", group = "Refactor" }, + { message = "^style", group = "Styling" }, + { message = "^test", group = "Testing" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = false diff --git a/example/Cargo.toml b/example/Cargo.toml index 0d33db6..41b4cc3 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -2,6 +2,7 @@ name = "mimalloc_example" version = "0.1.0" edition = "2024" +publish = false [lib] crate-type = ["cdylib", "lib"] diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 0000000..ec6edac --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,4 @@ +[workspace] +semver_check = true +allow_dirty = true # The "fixtures" is being marked as dirty. +changelog_config = "cliff.toml"