From 4ab6624add5de4e52fe2aff373b1a2f22f2557bb Mon Sep 17 00:00:00 2001 From: "Max P." Date: Sat, 14 Jun 2025 18:49:22 +0200 Subject: [PATCH] feat(workflows): enhance release process with additional steps - Update action reference to use the main branch for stability - Add scripts for version detection, CLI version reading, and git-cliff installation - Include setup for git configuration and changelog generation - Improve release logic based on version changes and branch checks --- .gitea/workflows/release.yml | 4 +--- action.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 111c064..cabcbc8 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -11,6 +11,4 @@ jobs: runs-on: ubuntu-latest steps: - name: Release - uses: https://git.0xmax42.io/actions/auto-changelog-release-action@978d002e9eb82247da53ddfb4fa2226527290919 - with: - fetch-depth: 0 + uses: https://git.0xmax42.io/actions/auto-changelog-release-action@main diff --git a/action.yml b/action.yml index f6ebb90..ec80ed9 100644 --- a/action.yml +++ b/action.yml @@ -25,3 +25,32 @@ runs: 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