name: "Release Commit"
on:
workflow_dispatch:
inputs:
bump_level:
description: "What type of release is this?"
required: true
type: choice
options:
- minor
- patch
permissions:
contents: write
jobs:
setup-environment:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 token: ${{ secrets.BOT_ACCESS_TOKEN }}
- name: Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install cargo about and cargo deny for create_release_changes script
run: |
cargo install --locked cargo-about
cargo install --locked cargo-deny
- name: Add git tag to release
run: ./scripts/create_release_changes "${{ github.event.inputs.bump_level }}"
- name: Get new cargo version
id: cargo_version
run: |
VERSION=$(cargo read-manifest | jq -r ".version")
echo "value=v$VERSION" >> $GITHUB_OUTPUT
- name: Ensure this release doesn't already exist
run: |
if [[ -n $(git log --grep="Release ${{ steps.cargo_version.outputs.value }}") ]]; then
echo "Release commit already exists: \"Release ${{ steps.cargo_version.outputs.value}}\""
exit 1
else
echo "No matching release commit found, proceeding..."
fi
- name: Commit the changes
uses: stefanzweifel/git-auto-commit-action@ac8823709a85c7ce090849ac3e5fe24d006f6e18 with:
commit_message: "Release ${{ steps.cargo_version.outputs.value }}"
branch: ${{ github.head_ref }}
commit_user_name: tinted-theming-bot
commit_user_email: tintedtheming@proton.me
commit_author: tinted-theming-bot <tintedtheming@proton.me>