Skip to content

Commit 2e4ef69

Browse files
author
Release Manager
committed
gh-40843: Restore release notes creation step <!-- ^ 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 discussed in https://groups.google.com/g/sage- devel/c/LFfhN0CpGJ8. However, we retain the idea of #40709 that a github release is made only in one step in the workflow. Previously, before #40709, a github release was made in two steps "Create release" and "Create release assets". This strategy worked well but started failing some months ago. Test (with #40840): https://github.com/kwankyu/sage/actions/runs/17846547780. ### 📝 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: #40843 Reported by: Kwankyu Lee Reviewer(s):
2 parents b0b0395 + b47b032 commit 2e4ef69

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

.github/workflows/dist.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,32 @@ jobs:
133133
name: dist
134134
path: dist
135135

136-
- name: Create release assets
136+
- name: Create release notes
137+
env:
138+
GITHUB_PAT: ${{ secrets.RELEASE_CREATION_TOKEN }}
139+
run: |
140+
latest_release_tag=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \
141+
| jq -r 'sort_by(.created_at) | last(.[]).tag_name')
142+
release_notes=$(curl -s \
143+
-X POST \
144+
-H "Accept: application/vnd.github+json" \
145+
-H "Authorization: Bearer $GITHUB_PAT" \
146+
-H "X-GitHub-Api-Version: 2022-11-28" \
147+
https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \
148+
-d "{
149+
\"tag_name\": \"${{ github.ref_name }}\",
150+
\"previous_tag_name\": \"$latest_release_tag\"
151+
}" | jq -r '.body')
152+
echo "$release_notes" > release_notes
153+
154+
- name: Create release
137155
uses: softprops/action-gh-release@v2
138156
with:
139157
files: |
140158
dist/*
141159
upstream/*
142160
token: ${{ secrets.RELEASE_CREATION_TOKEN }}
143-
generate_release_notes: true
161+
body_path: release_notes
144162
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
145163

146164
build_wheels:

0 commit comments

Comments
 (0)