name: Bump-n-Release
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_dispatch:
inputs:
component:
description: The version component to increase
type: choice
required: true
default: patch
options:
- major
- minor
- patch
- rc
permissions: {}
jobs:
bump-release:
if: github.event_name == 'workflow_dispatch'
environment:
name: stage-deployment
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.BUMP_N_RELEASE }}
fetch-depth: 0
fetch-tags: true
persist-credentials: true
- name: Setup nushell
uses: hustcer/setup-nu@92c296ba1ba2ba04cc948ab64ddefe192dc13f0c with:
version: "*"
- uses: cargo-bins/cargo-binstall@0b24824336e2b3800b0f89d9e08b2c08bfa3dcdd - name: Install git-cliff
run: cargo binstall -y git-cliff
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Install cargo-edit
run: >-
cargo install
--no-default-features
--features set-version
--bin cargo-set-version
cargo-edit
- name: Bump ${{ inputs.component }} version
env:
GITHUB_TOKEN: ${{ secrets.BUMP_N_RELEASE }}
run: nu .github/workflows/bump-n-release.nu ${{ inputs.component }}
unreleased-changes:
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- uses: actions/setup-python@v6
id: python-setup
with:
python-version: '3.x'
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 with:
enable-cache: false
- name: Generate a changelog
env:
GIT_CLIFF_CONFIG: .config/cliff.toml
GITHUB_REPO: ${{ github.repository }}
run: >-
uvx --constraints .github/requirements.txt
git-cliff --unreleased --output "${GITHUB_STEP_SUMMARY}"