diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 538b44d1431..2033e97b90e 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -119,10 +119,27 @@ 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') + 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 }}", + "previous_tag_name": "${latest_release_tag}", + "prerelease": ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}, + "generate_release_notes": true + }' + - 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/*