-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Prepare Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
level: | ||
type: choice | ||
description: Version to release | ||
required: true | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
# - release | ||
# - rc | ||
# - beta | ||
# - alpha | ||
|
||
jobs: | ||
make-release-pr: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
# cache cargo release so we don't have to install it every time | ||
- name: Cache cargo release and rust install steps | ||
id: cache-release | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
~/target/ | ||
key: ${{ runner.os }}-cargo-release | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Install cargo-release | ||
if: steps.cache-release.outputs.cache-hit != 'true' | ||
run: cargo install cargo-release | ||
|
||
- name: Setup Git info | ||
run: | | ||
git config user.name "Github Actions: Release" | ||
git config user.email "<>" | ||
- name: Bump version | ||
run: | | ||
# --no-publish: do not publish to crates.io | ||
# --no-tag: do not push tag for each new version | ||
# --no-push: do not push the update commits | ||
# --execute: not a dry run | ||
cargo release ${{ inputs.level }} \ | ||
--no-publish \ | ||
--no-tag \ | ||
--no-push \ | ||
--no-confirm \ | ||
--execute | ||
- name: Get package version | ||
id: cargo-get | ||
uses: nicolaiunrein/cargo-get@master | ||
with: | ||
subcommand: package.version | ||
|
||
- name: Create PR | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
delete-branch: true | ||
base: 'main' | ||
branch: 'release/${{ steps.cargo-get.outputs.metadata }}' | ||
labels: 'C-Release' | ||
title: 'Preparing Release ${{ steps.cargo-get.outputs.metadata }}' | ||
body: | | ||
Preparing the release of `${{ steps.cargo-get.outputs.metadata }}` | ||
This PR has been auto-generated |