From 4ca7bf3015f11e2e436e1ea277cd98c33f2044c8 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. --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ crates/panic-handler/Cargo.toml | 1 + testcrate/Cargo.toml | 1 + 3 files changed, 34 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..094f61c8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +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: Disable `libm` + # Technically we could just not checkout the submodule, but keep this + # step in case it becomes something else (subtree, part of this repo). + 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/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