From 3da625d3299f5975fd5d12df8968bea6e29e629c Mon Sep 17 00:00:00 2001 From: David Darras <117278497+davdarras@users.noreply.github.com> Date: Thu, 4 May 2023 16:53:54 +0200 Subject: [PATCH] feat: generate changelog with conventional commits --- .github/release.yml | 17 ----------------- .github/workflows/release-develop.yml | 19 +++++++++++++++++-- .github/workflows/release-main.yml | 19 +++++++++++++++++-- CHANGELOG.md | 0 package.json | 2 +- 5 files changed, 35 insertions(+), 22 deletions(-) delete mode 100644 .github/release.yml delete mode 100644 CHANGELOG.md diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index 2376a53..0000000 --- a/.github/release.yml +++ /dev/null @@ -1,17 +0,0 @@ -changelog: - categories: - - title: Breaking Changes 🛠 - labels: - - breaking - - title: Exciting New Features 🎉 - labels: - - enhancement - - title: Fixes 🔧 - labels: - - bug - - title: Documentation 📓 - labels: - - documentation - - title: Other Changes - labels: - - "*" diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 5a2c6c2..0d78906 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -39,12 +39,27 @@ jobs: - uses: actions/checkout@v3 with: ref: ${{ github.ref }} + fetch-depth: 0 + - name: Get previous tag + id: previousTag + run: echo "previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+\-rc$' | tail -1)" >> $GITHUB_OUTPUT + + - name: Create release note + id: changelog + uses: requarks/changelog-action@v1 + with: + fromTag: ${{ github.sha }} + toTag: ${{ steps.previousTag.outputs.previousTag}} + token: ${{ secrets.GITHUB_TOKEN }} + writeToFile: false + - uses: softprops/action-gh-release@v1 with: tag_name: ${{ needs.check-version.outputs.release-version }} - target_commitish: ${{ github.head_ref || github.ref }} - generate_release_notes: true + target_commitish: ${{ github.head_ref || github.ref }} + name: ${{ needs.check-version.outputs.release-version }} + body: ${{steps.changelog.outputs.changes}} prerelease: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-main.yml b/.github/workflows/release-main.yml index 484ceb0..e54f631 100644 --- a/.github/workflows/release-main.yml +++ b/.github/workflows/release-main.yml @@ -39,12 +39,27 @@ jobs: - uses: actions/checkout@v3 with: ref: ${{ github.ref }} + fetch-depth: 0 + - name: Get previous tag + id: previousTag + run: echo "previousTag=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+$' | tail -1)" >> $GITHUB_OUTPUT + + - name: Create release note + id: changelog + uses: requarks/changelog-action@v1 + with: + fromTag: ${{ github.sha }} + toTag: ${{ steps.previousTag.outputs.previousTag}} + token: ${{ secrets.GITHUB_TOKEN }} + writeToFile: false + - uses: softprops/action-gh-release@v1 with: tag_name: ${{ needs.check-version.outputs.release-version }} - target_commitish: ${{ github.head_ref || github.ref }} - generate_release_notes: true + target_commitish: ${{ github.head_ref || github.ref }} + name: ${{ needs.check-version.outputs.release-version }} + body: ${{steps.changelog.outputs.changes}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e69de29..0000000 diff --git a/package.json b/package.json index 4617e0f..157f65d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "public-enemy", - "version": "2.0.1", + "version": "2.0.2", "description": "Check and test questionnaire models", "repository": { "type": "git",