Skip to content

Commit 65a38a5

Browse files
author
Release Manager
committed
gh-39194: Reimplement release creation workflow <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> Fixes the issue raised in sagemath/website#480 (comment) I manually edited the release https://github.com/sagemath/sage/releases/tag/10.5 generated by an workflow implemented in sagemath/website#480 to correct the changelog https://github.com/sagemath/website/blob/master/sr c/changelogs/sage-10.5.txt, which is now in good shape. But see, for example, https://github.com/sagemath/sage/releases/tag/10.4 that contains all changes in betas and rcs. This PR is for automatic generation of a release that contains only changes from the last release. test: https://github.com/kwankyu/sage/releases https://github.com/kwankyu/sage/actions/runs/12485317339/job/34844199681 ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #39194 Reported by: Kwankyu Lee Reviewer(s): Soham Rane
2 parents a5c4b48 + 28ef753 commit 65a38a5

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

.github/workflows/dist.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,36 @@ 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+
release_notes=$(curl -s \
129+
-X POST \
130+
-H "Accept: application/vnd.github+json" \
131+
-H "Authorization: Bearer $GITHUB_TOKEN" \
132+
-H "X-GitHub-Api-Version: 2022-11-28" \
133+
https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \
134+
-d "{
135+
\"tag_name\": \"${{ github.ref_name }}\",
136+
\"previous_tag_name\": \"$latest_release_tag\"
137+
}" | jq -r '.body')
138+
curl -L \
139+
-X POST \
140+
-H "Accept: application/vnd.github+json" \
141+
-H "Authorization: Bearer $GITHUB_TOKEN" \
142+
-H "X-GitHub-Api-Version: 2022-11-28" \
143+
https://api.github.com/repos/${{ github.repository }}/releases \
144+
-d "{
145+
\"tag_name\": \"${{ github.ref_name }}\",
146+
\"prerelease\": ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }},
147+
\"body\": \"$release_notes\"
148+
}"
149+
- name: Create release assets
150+
uses: softprops/action-gh-release@v2
123151
with:
124-
generate_release_notes: true
125-
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
126152
files: |
127153
dist/*
128154
upstream/*

0 commit comments

Comments
 (0)