From 1cc3bc421cbc5c00c8bbe0a87d3270352b796b14 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 18 Jul 2024 00:29:04 -0500 Subject: [PATCH] Add `release-plz` for automatic releases. This is what `cc-rs` is using and should create a release PR whenever a change to `master` is made. If the branch is merged, it should publish the new version. Includes configuration to disable semver checks and not keep a changelog since this is an implementation detail. --- .github/workflows/publish.yml | 30 ++++++++++++++++++++++++++++++ .release-plz.toml | 3 +++ crates/panic-handler/Cargo.toml | 1 + testcrate/Cargo.toml | 1 + 4 files changed, 35 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .release-plz.toml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..d568f375 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,30 @@ +name: Release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - master + +jobs: + release-plz: + name: Release-plz + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + - name: Install Rust (rustup) + run: rustup update nightly --no-self-update && rustup default nightly + - name: Publish `libm` as part of builtins, rather than its own crate + run: rm libm/Cargo.toml + - 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/.release-plz.toml b/.release-plz.toml new file mode 100644 index 00000000..affc1026 --- /dev/null +++ b/.release-plz.toml @@ -0,0 +1,3 @@ +[workspace] +changelog_update = false +semver_check = false diff --git a/crates/panic-handler/Cargo.toml b/crates/panic-handler/Cargo.toml index 4fb81eb8..2ad85840 100644 --- a/crates/panic-handler/Cargo.toml +++ b/crates/panic-handler/Cargo.toml @@ -3,5 +3,6 @@ name = "panic-handler" version = "0.1.0" authors = ["Alex Crichton "] edition = "2021" +publish = false [dependencies] diff --git a/testcrate/Cargo.toml b/testcrate/Cargo.toml index 6b5c4cf4..e39c35b6 100644 --- a/testcrate/Cargo.toml +++ b/testcrate/Cargo.toml @@ -3,6 +3,7 @@ name = "testcrate" version = "0.1.0" authors = ["Alex Crichton "] edition = "2021" +publish = false [lib] test = false