From d1ed7a7de1cffd9740bd1913158089dc01dbbf58 Mon Sep 17 00:00:00 2001 From: David Bernard Date: Mon, 23 Sep 2024 15:17:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20switch=20to=20release-plz=20and?= =?UTF-8?q?=20remove=20cargo-make?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/{ci.yaml => ci.yml} | 30 +++++++++++++----------- .github/workflows/release-plz.yml | 33 +++++++++++++++++++++++++++ Makefile.toml | 10 -------- release-plz.toml | 33 +++++++++++++++++++++++++++ release.toml | 10 -------- 5 files changed, 83 insertions(+), 33 deletions(-) rename .github/workflows/{ci.yaml => ci.yml} (50%) create mode 100644 .github/workflows/release-plz.yml delete mode 100644 Makefile.toml create mode 100644 release-plz.toml delete mode 100644 release.toml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yml similarity index 50% rename from .github/workflows/ci.yaml rename to .github/workflows/ci.yml index e872657..d7fd6b3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yml @@ -9,6 +9,13 @@ on: # tags-ignore: # - "[0-9]+.[0-9]+.[0-9]+*" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + jobs: build: runs-on: ${{ matrix.os.imageName }} @@ -18,27 +25,24 @@ jobs: os: - imageName: ubuntu-latest profile_rustup: default - profile_ci_flow: ci-static-code-analysis-tasks - imageName: "macOS-latest" profile_rustup: minimal - profile_ci_flow: none - imageName: windows-latest profile_rustup: minimal - profile_ci_flow: none - + env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust_toolchain }} override: true profile: ${{matrix.os.profile_rustup}} - - uses: davidB/rust-cargo-make@v1 - uses: actions/checkout@v4 - - name: Run tests - run: cargo make --profile "${{matrix.os.profile_ci_flow}}" ci-flow - env: - # for list of xcode sdk see https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners#xcode - # DEVELOPER_DIR: "/Applications/Xcode_11.app/Contents/Developer" - CARGO_MAKE_RUN_CODECOV: "true" - # to have CODECOV_TOKEN go to https://codecov.io/gh/${GITHUB_USER}/${GITHUB_REPO} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - uses: mozilla-actions/sccache-action@v0.0.5 + - run: cargo clippy + - run: cargo test + - run: ${SCCACHE_PATH} --show-stats + shell: bash diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 0000000..6e55146 --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,33 @@ +name: release-plz + +on: + workflow_dispatch: + push: + branches: + - main + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + pull-requests: write + contents: write + +jobs: + release-plz: + name: Release-plz + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Makefile.toml b/Makefile.toml deleted file mode 100644 index 71f68fb..0000000 --- a/Makefile.toml +++ /dev/null @@ -1,10 +0,0 @@ -# see https://crates.io/crates/cargo-make - -[env] -RUST_TEST_THREADS = "1" -CARGO_MAKE_TEST_COVERAGE_BINARY_FILTER = "cli-[a-z0-9]*$\\|makers-[a-z0-9]*$\\|${CARGO_MAKE_TEST_COVERAGE_DEFAULT_BINARY_FILTER}" - -[tasks.publish] -command = "cargo" -args = ["release", "${@}"] - diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 0000000..02bf49f --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,33 @@ +# [Configuration | Release-plz](https://release-plz.ieni.dev/docs/config) +# [workspace] +# features_always_increment_minor = true + +[changelog] +sort_commits = "newest" +commit_preprocessors = [ + # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, # remove issue numbers from commits + # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, # replace issue numbers +] +# regex for parsing and grouping commits +# try to follow [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) +commit_parsers = [ + { message = "^(🔒️|🔐)", group = "Security" }, + { body = ".*security", group = "Security" }, + { message = "^(fix|🐛|🚑️|👽️)", group = "Fixed" }, + { message = "^(test|✅)", group = "Fixed", skip = true }, + { message = "^.*: add", group = "Added" }, + { message = "^.*: support", group = "Added" }, + { message = "^(feat|✨|💥)", group = "Added" }, + { message = "^.*: remove", group = "Removed" }, + { message = "^.*: delete", group = "Removed" }, + { message = "^(style|💄)", group = "Changed" }, + { message = "^(doc|✏️|📝)", group = "Changed" }, + { message = "^(perf|⚡️)", group = "Changed" }, + { message = "^(chore|ci|💚|👷|🚧)", group = "Changed", skip = true }, + { message = "^revert", group = "Changed" }, + { message = "^(chore\\(deps\\)|⬇️|⬆️|➕|➖)", group = "Changed" }, + { message = "^(refactor|🎨|🔥|♻️)", group = "Refactor", skip = true }, + { message = "^(chore\\(release\\): prepare for|🔖|🚀)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, +] diff --git a/release.toml b/release.toml deleted file mode 100644 index f1656cd..0000000 --- a/release.toml +++ /dev/null @@ -1,10 +0,0 @@ -pre-release-commit-message = ":rocket: (cargo-release) version {{version}}" -# post-release-commit-message=":construction: (cargo-release) start next development iteration {{next_version}}" -tag-prefix = "" -tag-name = "{{prefix}}{{version}}" -tag-message = ":bookmark: {{version}}" -# dev-version-ext = "dev" -# pre-release-replacements = [ -# {file="CHANGELOG.md", search="x.y.z-dev", replace="{{version}}"}, -# {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}"} -# ]