From 7da7664ca0257a881c49b007a8c96e11fa4d26e5 Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 27 Apr 2026 22:48:13 -0400 Subject: [PATCH] ci: add Gitea workflow to automate releases on PR merge --- .gitea/workflows/release.yaml | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .gitea/workflows/release.yaml diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..84d9969 --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -0,0 +1,47 @@ +name: Release on Merge + +on: + pull_request: + types: [closed] + branches: + - main + +jobs: + release: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set Tag Name + id: tag + run: echo "tag=v$(date +'%Y.%m.%d-%H%M')" >> $GITHUB_OUTPUT + + - name: Generate Changelog + id: changelog + run: | + echo "CHANGELOG<> $GITHUB_OUTPUT + git log --pretty=format:"- %s (%h)" ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} >> $GITHUB_OUTPUT + echo "" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create Release and Upload Asset + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.tag.outputs.tag }} + name: "Release: ${{ github.event.pull_request.title }}" + body: | + ## Summary + ${{ github.event.pull_request.body }} + + ## Changelog + ${{ steps.changelog.outputs.CHANGELOG }} + files: | + color-tool + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}