From 18490a349b3da492a3267122de4ef6d92fdfba44 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Tue, 24 Dec 2024 23:31:57 +0900 Subject: [PATCH 1/2] Fix release creation --- .github/workflows/dist.yml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 538b44d1431..9888f2f1095 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -119,10 +119,38 @@ jobs: with: name: dist path: dist - - uses: softprops/action-gh-release@v2 + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + latest_release_tag=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \ + | jq -r 'sort_by(.created_at) | last(.[]).tag_name') + + release_notes=$(curl -s \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \ + -d "{ + \"tag_name\": \"${{ github.ref_name }}\", + \"previous_tag_name\": \"$latest_release_tag\" + }" | jq -r '.body') + + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/${{ github.repository }}/releases \ + -d "{ + \"tag_name\": \"${{ github.ref_name }}\", + \"prerelease\": ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}, + \"body\": \"$release_notes\" + }" + - name: Create release assets + uses: softprops/action-gh-release@v2 with: - generate_release_notes: true - prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }} files: | dist/* upstream/* From 28ef7538ff38548df3f403bcccf74cee4134ac65 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Wed, 25 Dec 2024 04:23:11 +0900 Subject: [PATCH 2/2] Remove empty lines --- .github/workflows/dist.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 9888f2f1095..191fd1c8fad 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -125,7 +125,6 @@ jobs: run: | latest_release_tag=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \ | jq -r 'sort_by(.created_at) | last(.[]).tag_name') - release_notes=$(curl -s \ -X POST \ -H "Accept: application/vnd.github+json" \ @@ -136,7 +135,6 @@ jobs: \"tag_name\": \"${{ github.ref_name }}\", \"previous_tag_name\": \"$latest_release_tag\" }" | jq -r '.body') - curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \