Skip to content

Commit 18490a3

Browse files
committed
Fix release creation
1 parent c9dd1e8 commit 18490a3

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

.github/workflows/dist.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,38 @@ jobs:
119119
with:
120120
name: dist
121121
path: dist
122-
- uses: softprops/action-gh-release@v2
122+
- name: Create release
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
run: |
126+
latest_release_tag=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \
127+
| jq -r 'sort_by(.created_at) | last(.[]).tag_name')
128+
129+
release_notes=$(curl -s \
130+
-X POST \
131+
-H "Accept: application/vnd.github+json" \
132+
-H "Authorization: Bearer $GITHUB_TOKEN" \
133+
-H "X-GitHub-Api-Version: 2022-11-28" \
134+
https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \
135+
-d "{
136+
\"tag_name\": \"${{ github.ref_name }}\",
137+
\"previous_tag_name\": \"$latest_release_tag\"
138+
}" | jq -r '.body')
139+
140+
curl -L \
141+
-X POST \
142+
-H "Accept: application/vnd.github+json" \
143+
-H "Authorization: Bearer $GITHUB_TOKEN" \
144+
-H "X-GitHub-Api-Version: 2022-11-28" \
145+
https://api.github.com/repos/${{ github.repository }}/releases \
146+
-d "{
147+
\"tag_name\": \"${{ github.ref_name }}\",
148+
\"prerelease\": ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }},
149+
\"body\": \"$release_notes\"
150+
}"
151+
- name: Create release assets
152+
uses: softprops/action-gh-release@v2
123153
with:
124-
generate_release_notes: true
125-
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
126154
files: |
127155
dist/*
128156
upstream/*

0 commit comments

Comments
 (0)