diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..fe1351d6 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,31 @@ +name-template: 'v$RESOLVED_VERSION 🌈' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. +version-resolver: + major: + labels: + - 'major' + minor: + labels: + - 'minor' + patch: + labels: + - 'patch' + default: patch +template: | + ## Changes + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc90445e..04813e65 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,34 +112,16 @@ jobs: color: green # Prepare a draft release for GitHub Releases page for the manual verification # If accepted and published, release workflow would be triggered - releaseDraft: - name: Release Draft - if: github.event_name != 'pull_request' + update_release_draft: + permissions: + # write permission is required to create a github release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: write needs: test runs-on: ubuntu-latest steps: - # Check out current repository - - name: Fetch Sources - uses: actions/checkout@v3 - - # Remove old release drafts by using the curl request for the available releases with draft flag - - name: Remove Old Release Drafts - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh api repos/{owner}/{repo}/releases \ - --jq '.[] | select(.draft == true) | .id' \ - | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} - # Create new release draft - which is not publicly visible and requires manual acceptance - - name: Create Release Draft + - uses: release-drafter/release-drafter@v5 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh release create v${{ needs.build.outputs.version }} \ - --draft \ - --title "v${{ needs.build.outputs.version }}" \ - --notes "$(cat << 'EOM' - ${{ needs.build.outputs.version }} - EOM - )" - echo "::notice title=New release draft::${{ needs.build.outputs.version }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file