Skip to content

Commit fbe24d6

Browse files
author
Release Manager
committed
gh-40709: Fix release dist 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". --> The release workflow fails currently (https://github.com/sagemath/sage/a ctions/runs/16854260655/job/47745153961) at those two points: - Upload release assests - Build wheels The first is fixed by using the action `softprops/action-gh-release` to create the release and upload the assets at the same time. The second issue is fixed by disabling wheel building for now (it would be good to investigate wheel building for sagelib). Along the way, removed a few outdated things (like sdist for old sagelib-with-setuptools or wheel building for sage-conf). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] 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: #40709 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
2 parents 1cfd52c + 788a0a3 commit fbe24d6

File tree

2 files changed

+15
-98
lines changed

2 files changed

+15
-98
lines changed

.github/workflows/dist.yml

Lines changed: 13 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
upstream
7979
name: release_dist
8080

81-
sdists_for_pypi:
81+
sdists:
8282

8383
runs-on: ubuntu-latest
8484
env:
@@ -102,15 +102,6 @@ jobs:
102102
run: |
103103
conda install --yes python-build
104104
python -m build --sdist --no-isolation --outdir dist .
105-
106-
- name: Old sagemath-standard
107-
run: |
108-
sudo DEBIAN_FRONTEND=noninteractive apt-get update
109-
sudo DEBIAN_FRONTEND=noninteractive apt-get install $(build/bin/sage-get-system-packages debian _bootstrap _prereq)
110-
./bootstrap
111-
./configure
112-
make pypi-sdists V=0
113-
mv upstream/sage*.tar.gz dist/
114105
ls -l dist
115106
116107
- uses: actions/upload-artifact@v4
@@ -127,92 +118,37 @@ jobs:
127118
if: env.CAN_DEPLOY == 'true'
128119

129120
release:
130-
131-
needs: [release_dist, sdists_for_pypi]
121+
needs: [release_dist, sdists]
132122
runs-on: ubuntu-latest
133-
if: (success() || failure()) && github.repository == 'sagemath/sage' && startsWith(github.ref, 'refs/tags/')
123+
if: github.ref_type == 'tag'
124+
permissions:
125+
contents: write
134126
steps:
135127
- uses: actions/download-artifact@v4
136128
with:
137129
name: release_dist
130+
138131
- uses: actions/download-artifact@v4
139132
with:
140133
name: dist
141134
path: dist
142-
- name: Create release
143-
env:
144-
GITHUB_PAT: ${{ secrets.RELEASE_CREATION_TOKEN }}
145-
run: |
146-
latest_release_tag=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \
147-
| jq -r 'sort_by(.created_at) | last(.[]).tag_name')
148-
release_notes=$(curl -s \
149-
-X POST \
150-
-H "Accept: application/vnd.github+json" \
151-
-H "Authorization: Bearer $GITHUB_PAT" \
152-
-H "X-GitHub-Api-Version: 2022-11-28" \
153-
https://api.github.com/repos/${{ github.repository }}/releases/generate-notes \
154-
-d "{
155-
\"tag_name\": \"${{ github.ref_name }}\",
156-
\"previous_tag_name\": \"$latest_release_tag\"
157-
}" | jq -r '.body')
158-
# escape special characters for json
159-
release_notes=$(jq -R -s '.' <<< "$release_notes")
160-
curl -L \
161-
-X POST \
162-
-H "Accept: application/vnd.github+json" \
163-
-H "Authorization: Bearer $GITHUB_PAT" \
164-
-H "X-GitHub-Api-Version: 2022-11-28" \
165-
https://api.github.com/repos/${{ github.repository }}/releases \
166-
-d "{
167-
\"tag_name\": \"${{ github.ref_name }}\",
168-
\"prerelease\": ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }},
169-
\"body\": $release_notes
170-
}"
135+
171136
- name: Create release assets
172137
uses: softprops/action-gh-release@v2
173138
with:
174139
files: |
175140
dist/*
176141
upstream/*
177-
token: ${{ secrets.GITHUB_TOKEN }}
178-
tag_name: ${{ github.ref_name }}
179-
permissions:
180-
contents: write
181-
182-
noarch_wheels_for_pypi:
183-
184-
runs-on: ubuntu-latest
185-
env:
186-
CAN_DEPLOY: ${{ secrets.SAGEMATH_PYPI_API_TOKEN != '' && github.event_name != 'pull_request' }}
187-
steps:
188-
- uses: actions/checkout@v4
189-
- name: Install bootstrap prerequisites
190-
run: |
191-
sudo DEBIAN_FRONTEND=noninteractive apt-get update
192-
sudo DEBIAN_FRONTEND=noninteractive apt-get install $(build/bin/sage-get-system-packages debian _bootstrap _prereq)
193-
- name: make pypi-noarch-wheels
194-
run: |
195-
./bootstrap
196-
./configure
197-
make pypi-noarch-wheels V=0
198-
(mkdir dist && mv venv/var/lib/sage/wheels/sage*-none-any.whl dist/)
199-
ls -l dist
200-
- uses: actions/upload-artifact@v4
201-
with:
202-
path: "dist/*.whl"
203-
name: noarch-wheels
204-
- uses: pypa/gh-action-pypi-publish@release/v1
205-
with:
206-
user: __token__
207-
password: ${{ secrets.SAGEMATH_PYPI_API_TOKEN }}
208-
skip-existing: true
209-
verbose: true
210-
if: env.CAN_DEPLOY == 'true'
142+
token: ${{ secrets.RELEASE_CREATION_TOKEN }}
143+
generate_release_notes: true
144+
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
211145

212146
build_wheels:
147+
# Temporarily disabled due to build errors
148+
if: false
213149
name: wheels ${{ matrix.build }}*_${{ matrix.arch }}
214150
runs-on: ${{ matrix.os }}
215-
needs: sdists_for_pypi
151+
needs: sdists
216152
strategy:
217153
fail-fast: false
218154
matrix:
@@ -293,10 +229,6 @@ jobs:
293229
(cd unpacked && tar xfz - ) < $sdist
294230
done
295231
296-
- name: sagemath-objects
297-
run: |
298-
"${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*objects*
299-
300232
- name: sagemath-bliss
301233
run: |
302234
"${{ steps.python.outputs.python-path }}" -m cibuildwheel unpacked/sagemath*bliss*

build/make/Makefile.in

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,8 @@ PIP_PACKAGES = @SAGE_PIP_PACKAGES@
130130
# Packages that use the 'script' package build rules
131131
SCRIPT_PACKAGES = @SAGE_SCRIPT_PACKAGES@
132132

133-
# Packages for which we build platform-independent wheels for PyPI
134-
PYPI_NOARCH_WHEEL_PACKAGES = \
135-
sage_setup \
136-
sagemath_environment \
137-
138133
# Packages for which we build wheels for PyPI
139-
PYPI_WHEEL_PACKAGES = $(PYPI_NOARCH_WHEEL_PACKAGES) \
140-
sagemath_objects \
141-
sagemath_repl \
142-
sagemath_categories \
134+
PYPI_WHEEL_PACKAGES = \
143135
sagemath_bliss \
144136
sagemath_mcqd \
145137
sagemath_tdlib \
@@ -224,7 +216,7 @@ SAGE_I_TARGETS = sagelib doc
224216
# Tell make not to look for files with these names:
225217
.PHONY: all all-sage all-toolchain all-build all-sageruntime \
226218
all-start build-start toolchain toolchain-deps base-toolchain \
227-
pypi-sdists pypi-noarch-wheels pypi-wheels wheels \
219+
pypi-sdists pypi-wheels wheels \
228220
sagelib \
229221
doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
230222
doc-uninstall \
@@ -450,13 +442,6 @@ pypi-sdists: $(PYPI_SDIST_PACKAGES:%=%-sdist)
450442
# Ensuring wheels are present, even for packages that may have been installed
451443
# as editable. Until we have better uninstallation of script packages, we
452444
# just remove the timestamps, which will lead to rebuilds of the packages.
453-
pypi-noarch-wheels:
454-
for a in $(PYPI_NOARCH_WHEEL_PACKAGES); do \
455-
rm -f $(SAGE_VENV)/var/lib/sage/installed/$$a-*; \
456-
done
457-
$(MAKE_REC) SAGE_EDITABLE=no SAGE_WHEELS=yes $(PYPI_NOARCH_WHEEL_PACKAGES)
458-
@echo "Built wheels are in venv/var/lib/sage/wheels/"
459-
460445
pypi-wheels:
461446
for a in $(PYPI_WHEEL_PACKAGES); do \
462447
rm -f $(SAGE_VENV)/var/lib/sage/installed/$$a-*; \

0 commit comments

Comments
 (0)