Skip to content

Add support to create pre-releases with a generated changelog #32

Add support to create pre-releases with a generated changelog

Add support to create pre-releases with a generated changelog #32

Workflow file for this run

name: pre-release
on:
push:
tags: [ "[0-9]+.[0-9]+.[0-9]+*" ]
jobs:
create-pre-release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout commit
uses: actions/checkout@v6
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@main
with:
version: 1.0.0-pre1
- name: Use cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo
save-always: true
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Get the Git tag name
id: get-tag-name
run: echo "tag-name=${GITHUB_REF/refs\/tags\//}" | tee -a "$GITHUB_OUTPUT"
- id: release
name: Create changelog and release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cargo update --recursive git-cliff
gl-gh-release create \
--repo "python-gardenlinux-lib" \
--tag "${{ steps.get-tag-name.outputs.tag-name }}" \
--commit "${{ github.sha }}" \
--name 'python-gardenlinux-lib v${{ steps.get-tag-name.outputs.tag-name }}' \
--body "
Changes for v${{ steps.get-tag-name.outputs.tag-name }}
$(git-cliff -o - --current --topo-order")
"