From d27d5a350b43baa4e3123db996fa6d7fa0df27f1 Mon Sep 17 00:00:00 2001 From: Lex Christopherson Date: Fri, 23 Jan 2026 17:07:11 -0600 Subject: [PATCH] ci: restore auto-release workflow for GitHub Releases --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..9b1efd592 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Extract version from tag + id: version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + + - name: Extract changelog section + id: changelog + run: | + VERSION="${{ steps.version.outputs.VERSION }}" + awk -v ver="$VERSION" ' + /^## \[/ { + if (found) exit + if ($0 ~ "\\[" ver "\\]") found=1 + } + found {print} + ' CHANGELOG.md > release_notes.md + + if [ ! -s release_notes.md ]; then + echo "## v$VERSION" > release_notes.md + echo "" >> release_notes.md + echo "See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details." >> release_notes.md + fi + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + body_path: release_notes.md