diff --git a/.github/scripts/generate_release_notes.py b/.github/scripts/generate_release_notes.py index 50aeef3..f7d3066 100644 --- a/.github/scripts/generate_release_notes.py +++ b/.github/scripts/generate_release_notes.py @@ -57,7 +57,7 @@ def get_commits_since_last_tag(): return commit_logs def generate_release_notes(): - notes = "### ✨ Enhancements\\n" + notes = "### ✨ Enhancements\n" commit_logs = get_commits_since_last_tag() authorsSet = set() dependabotNotes = '' @@ -67,21 +67,21 @@ def generate_release_notes(): # Attempt to extract PR number from commit message pr_match = re.search(r'\(#(\d+)\)', message) pr_number = pr_match.group(1) if pr_match else '' - commitNote = f"* {message}\\n" + commitNote = f"* {message}\n" if dependabot in author: dependabotNotes += commitNote else: notes += commitNote authorsSet.add(author) else: - notes += "No changes were made since the last release.\\n" + notes += "No changes were made since the last release.\n" if dependabotNotes != "": - notes += "### 🔨 Dependencies\\n" + notes += "### 🔨 Dependencies\n" notes += dependabotNotes - notes += "\\n\\nThanks to " + getAuthorHandlesFromNames(authorsSet) - notes += "\\n\\nChange log " + repoUrl + "/compare/" + get_latest_tag() + "..." + calculate_next_tag() + notes += "\n\nThanks to " + getAuthorHandlesFromNames(authorsSet) + notes += "\n\nChange log " + repoUrl + "/compare/" + get_latest_tag() + "..." + calculate_next_tag() return notes if __name__ == "__main__": diff --git a/.github/workflows/create-tag-and-release.yml b/.github/workflows/create-tag-and-release.yml index 528ca82..bcdfece 100644 --- a/.github/workflows/create-tag-and-release.yml +++ b/.github/workflows/create-tag-and-release.yml @@ -28,24 +28,25 @@ jobs: run: echo "tag=$(python .github/scripts/calculate_next_tag.py)" >> $GITHUB_OUTPUT shell: bash - # - name: Generate release notes - # id: generate-notes - # run: | - # NOTES=$(python .github/scripts/generate_release_notes.py) - # NOTES="${NOTES//'%'/'%25'}" - # NOTES="${NOTES//$'\n'/'%0A'}" - # NOTES="${NOTES//$'\r'/'%0D'}" - # echo "::set-output name=notes::$NOTES" - - - name: Generate release notes v1 - id: generate-notes-v1 + - name: Generate release notes + id: generate-notes run: | NOTES=$(python .github/scripts/generate_release_notes.py) NOTES="${NOTES//'%'/'%25'}" NOTES="${NOTES//$'\n'/'%0A'}" NOTES="${NOTES//$'\r'/'%0D'}" - echo "notes=$NOTES" >> $GITHUB_OUTPUT + echo "::set-output name=notes::$NOTES" + + # - name: Generate release notes v1 + # id: generate-notes-v1 + # run: | + # NOTES=$(python .github/scripts/generate_release_notes.py) + # NOTES="${NOTES//'%'/'%25'}" + # NOTES="${NOTES//$'\n'/'%0A'}" + # NOTES="${NOTES//$'\r'/'%0D'}" + # echo "notes=$NOTES" >> $GITHUB_OUTPUT # https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ + # - name: Generate release notes v2 # id: generate-notes-v2 # run: | @@ -59,14 +60,10 @@ jobs: # echo "EOF" >> $GITHUB_OUTPUT # done - # - name: Generate release notes and encode - # id: generate-notes-v3 - # run: echo "notes=$(python .github/scripts/generate_release_notes.py)" >> $GITHUB_OUTPUT - # - name: Generate release notes and encode # id: generate-notes-v3 # run: | - # NOTES=$(python .github/scripts/generate_release_notes.py) + # NOTES=$(python .github/scripts/generate_release_notes.py | base64) # echo "notes=$NOTES" >> $GITHUB_OUTPUT # - name: Generate release notes @@ -75,7 +72,6 @@ jobs: # echo "notes<> $GITHUB_OUTPUT # python .github/scripts/generate_release_notes.py' # echo "EOF" >> $GITHUB_OUTPUT - # https://github.com/seljabali/release-notes-generator/actions/runs/8857213252/job/24324425228 - name: Create the new tag run: |