Skip to content

Commit

Permalink
ci: Update release-notes.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
matrei committed Dec 3, 2024
1 parent 64fc1d8 commit 47be73e
Showing 1 changed file with 11 additions and 39 deletions.
50 changes: 11 additions & 39 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,23 @@
name: Changelog
name: "Release Drafter"
on:
issues:
types: [closed,reopened]
types: [closed, reopened]
push:
branches:
- master
- '[4-9]+.[0-9]+.x'
pull_request:
types: [opened, reopened, synchronize, labeled]
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize, labeled]
types: [opened, reopened, synchronize]
workflow_dispatch:
jobs:
release_notes:
update_release_draft:
permissions:
contents: read # limit to read access
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check if it has release drafter config file
id: check_release_drafter
run: |
has_release_drafter=$([ -f .github/release-drafter.yml ] && echo "true" || echo "false")
echo "has_release_drafter=${has_release_drafter}" >> $GITHUB_OUTPUT
- name: Extract branch name
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
# If it has release drafter:
- uses: release-drafter/release-drafter@v5
if: steps.check_release_drafter.outputs.has_release_drafter == 'true'
- name: "📝 Update Release Draft"
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
commitish: ${{ steps.extract_branch.outputs.value }}
# Otherwise:
- name: Export Gradle Properties
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
uses: micronaut-projects/github-actions/export-gradle-properties@master
- uses: micronaut-projects/github-actions/release-notes@master
if: steps.check_release_drafter.outputs.has_release_drafter == 'false'
id: release_notes
with:
token: ${{ secrets.GH_TOKEN }}
- uses: ncipollo/release-action@v1
if: steps.check_release_drafter.outputs.has_release_drafter == 'false' && steps.release_notes.outputs.generated_changelog == 'true'
with:
allowUpdates: true
commit: ${{ steps.release_notes.outputs.current_branch }}
draft: true
name: "${{ env.title }} ${{ steps.release_notes.outputs.next_version }}"
tag: v${{ steps.release_notes.outputs.next_version }}
bodyFile: CHANGELOG.md
token: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

0 comments on commit 47be73e

Please sign in to comment.