From 2d3dbe4f6a73f90005858f85aed78285b0eefaa4 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 29 Aug 2024 21:07:41 -0500 Subject: [PATCH] fix pre-release --- .github/release-drafter.yml | 5 +++-- .github/workflows/pre-release.yaml | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 4116b65c..6118b3bf 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,5 +1,6 @@ -name-template: 'v$RESOLVED_VERSION' -tag-template: 'v$RESOLVED_VERSION' +name-template: '$RESOLVED_VERSION' +tag-template: '$RESOLVED_VERSION' +tag-prefix: "" categories: - title: '🚀 Features' labels: diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index b625011a..40a3ecfa 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -74,6 +74,13 @@ jobs: name: winutil path: ./winutil.ps1 + - name: Get latest release tag + id: get_latest_release + run: | + $latestTag = git describe --tags --abbrev=0 + echo "LATEST_TAG=$latestTag" >> $env:GITHUB_ENV + shell: pwsh + - name: Generate Release Notes id: generate_notes uses: release-drafter/release-drafter@v5 @@ -82,14 +89,17 @@ jobs: with: config-name: release-drafter.yml version: ${{ env.version }} + tag: ${{ env.LATEST_TAG }} - name: Prepare Release Body id: prepare_body run: | - new_changes="${{ steps.generate_notes.outputs.body }}" - echo "body<> $GITHUB_OUTPUT - echo "$new_changes" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + $newChanges = "${{ steps.generate_notes.outputs.body }}" + $formattedChanges = "Changes since ${{ env.LATEST_TAG }}:`n`n$newChanges" + echo "body<> $env:GITHUB_OUTPUT + echo "$formattedChanges" >> $env:GITHUB_OUTPUT + echo "EOF" >> $env:GITHUB_OUTPUT + shell: pwsh - name: Create and Upload Release id: create_release