diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..5e53d1c --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,14 @@ +changelog: + categories: + - title: Features + labels: + - enhancement + - title: Bug Fixes + labels: + - bug + - title: Other Changes + labels: + - "*" + exclude: + labels: + - skip-changelog diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9fa0923..dba2191 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,7 +2,7 @@ name: Release on: push: tags: - - 'v*' + - 'v[0-9]+.[0-9]+.[0-9]+' jobs: release: @@ -11,11 +11,53 @@ jobs: contents: write steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + + - name: Resolve previous tag + id: prev + run: | + PREV=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sed -n '2p') + echo "tag=${PREV:-}" >> "${GITHUB_OUTPUT}" + + - name: Build release notes + id: notes + run: | + VERSION="${GITHUB_REF_NAME}" + PREV="${{ steps.prev.outputs.tag }}" + + { + echo 'body<> "${GITHUB_OUTPUT}" - name: Create GitHub Release uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1 with: - generate_release_notes: true + body: ${{ steps.notes.outputs.body }} + make_latest: true - name: Update major version tag run: |