From 7bad5475390a927f14ed5eccd31c4268dd0d7a28 Mon Sep 17 00:00:00 2001 From: "Max P." Date: Sat, 14 Jun 2025 18:53:10 +0200 Subject: [PATCH] feat(workflow): enhance release process with additional steps - Add git-cliff installation and configuration for changelog generation - Include CLIFF_VERSION detection and handling - Improve git setup for release automation - Refine conditional steps for changelog and version release --- .gitea/workflows/release.yml | 3 +++ action.yml | 34 +++++++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index cabcbc8..94dbbf9 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -10,5 +10,8 @@ jobs: release: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Release uses: https://git.0xmax42.io/actions/auto-changelog-release-action@main diff --git a/action.yml b/action.yml index bd9c2f0..8b34b68 100644 --- a/action.yml +++ b/action.yml @@ -18,13 +18,37 @@ inputs: runs: using: "composite" steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Detect version change shell: bash id: detect run: | bash ${{ github.action_path }}/scripts/detect-version-change.sh + + - name: Read CLIFF_VERSION + shell: bash + id: cliff_version + run: bash ${{ github.action_path }}/scripts/read-cliff-version.sh + + - name: Install git-cliff + shell: bash + run: | + bash ${{ github.action_path }}/scripts/install-git-cliff.sh "${{ steps.cliff_version.outputs.version }}" + + - name: Set up git + shell: bash + run: | + bash ${{ github.action_path }}/scripts/setup-git.sh \ + "${{ inputs.author_name }}" \ + "${{ inputs.author_email }}" + + - name: Generate and commit changelog (unreleased) + if: steps.detect.outputs.version_changed == 'false' || github.ref != 'refs/heads/main' + shell: bash + run: bash ${{ github.action_path }}/scripts/generate-unreleased-changelog.sh + + - name: Release from VERSION + if: steps.detect.outputs.version_changed == 'true' && github.ref == 'refs/heads/main' + shell: bash + env: + RELEASE_PUBLISH_TOKEN: ${{ inputs.token || '' }} + run: bash ${{ github.action_path }}/scripts/release-from-version.sh