Skip to content

Commit

Permalink
chore: add release-plz workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandros committed Oct 16, 2024
1 parent c587d2c commit d65af97
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release-plz

permissions:
pull-requests: write
contents: write

on:
push:
tags:
- "*"

jobs:
# Release unpublished packages.
release-plz-release:
name: Release-plz release
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/[email protected]
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
name: Release-plz PR
runs-on: ubuntu-latest
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
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/[email protected]
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
36 changes: 36 additions & 0 deletions release-plz.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[workspace]
allow_dirty = false
dependencies_update = false # update dependencies with `cargo update`
git_release_enable = true # enable GitHub releases
pr_branch_prefix = "release-plz-" # PR branch prefix
pr_name = "Release {{ package }} v{{ version }}" # template for the PR name
pr_labels = ["release"] # add the `release` label to the release Pull Request
publish_allow_dirty = false # don't add `--allow-dirty` to `cargo publish`
semver_check = true # enable API breaking changes checks
publish_timeout = "10m" # set a timeout for `cargo publish`

[[package]]
name = "ferrunix"
changelog_include = ["ferrunix-core", "ferrunix-macros"] # include commits from others in the changelog
changelog_update = true # enable changelog update
git_release_enable = true # enable GitHub releases
publish = true # enable `cargo publish`

[[package]]
name = "ferrunix-core"
changelog_update = true # enable changelog update
git_release_enable = false # disable GitHub releases
publish = true # enable `cargo publish`

[[package]]
name = "ferrunix-macros"
changelog_update = true # enable changelog update
git_release_enable = false # disable GitHub releases
publish = true # enable `cargo publish`

[[package]]
name = "xtask"
release = false # don't process this package

[changelog]
protect_breaking_commits = true # always include commits with breaking changes in the changelog

0 comments on commit d65af97

Please sign in to comment.