1- name : Prepare source distributions and wheels
1+ name : Release
22
33on :
44 push :
1212 - ' [0-9]+.[0-9]+.[0-9]+.rc[0-9]+'
1313 pull_request :
1414 paths :
15- - ' .github/workflows/dist .yml'
15+ - ' .github/workflows/release .yml'
1616 workflow_dispatch :
1717 # Allow to run manually
1818
1919jobs :
2020
21- release_dist :
22-
23- # This job first checks whether "configure --enable-download-from-upstream-url"
24- # (the default since #32390) is needed.
25- #
26- # In this way, we check that all necessary package tarballs
27- # have already been uploaded to the Sage server at the time
28- # of pushing a release tag.
29- #
30- # It also uses "bootstrap -D", thus checking that the "configure"
31- # tarball has been uploaded to the Sage server at the time
32- # of pushing a release tag.
33-
21+ package_tarballs :
3422 runs-on : ubuntu-latest
3523 steps :
3624 - uses : actions/checkout@v4
3725 - name : Install bootstrap prerequisites
3826 run : |
3927 sudo DEBIAN_FRONTEND=noninteractive apt-get update
4028 sudo DEBIAN_FRONTEND=noninteractive apt-get install $(build/bin/sage-get-system-packages debian _bootstrap _prereq)
41- - name : make dist (--disable-download-from-upstream-url)
42- id : make_dist
43- run : |
44- ./bootstrap -D && ./configure --disable-download-from-upstream-url && make dist
45- env :
46- MAKE : make -j8
47- - name : make download (--disable-download-from-upstream-url)
48- id : make_download
49- run : |
50- make -k download DOWNLOAD_PACKAGES=":all: --no-file huge"
51- env :
52- MAKE : make -j8
53- - name : Reconfigure with --enable-download-from-upstream-url
54- if : (success() || failure()) && (steps.make_dist.outcome != 'success' || steps.make_download.outcome != 'success')
29+
30+ - name : Configure
5531 run : |
32+ ./bootstrap
5633 ./configure
57- - name : make dist (--enable-download-from-upstream-url)
58- if : (success() || failure()) && steps.make_dist.outcome != 'success'
59- run : |
60- make dist
61- env :
62- MAKE : make -j8
63- - name : make download (--enable-download-from-upstream-url)
64- if : (success() || failure()) && steps.make_download.outcome != 'success'
34+
35+ - name : Download tarballs of all packages
6536 run : |
66- make -k download DOWNLOAD_PACKAGES=":all: --no-file huge --allow-upstream"
67- env :
68- MAKE : make -j8
37+ build/bin/sage-package download :all: --no-file huge --allow-upstream
38+
6939 - name : Remove what cannot be distributed
70- if : success() || failure()
7140 run : |
7241 rm -f upstream/*do-not-distribute*
42+
43+ - name : List files
44+ run : |
45+ ls -l upstream
46+
7347 - uses : actions/upload-artifact@v4
74- if : success() || failure()
7548 with :
76- path : |
77- dist/*.tar.gz
78- upstream
79- name : release_dist
49+ path : upstream
50+ name : package_tarballs
8051
8152 sdists :
8253
@@ -118,15 +89,16 @@ jobs:
11889 if : env.CAN_DEPLOY == 'true'
11990
12091 release :
121- needs : [release_dist , sdists]
92+ needs : [package_tarballs , sdists]
12293 runs-on : ubuntu-latest
123- if : github.ref_type == 'tag'
12494 permissions :
12595 contents : write
96+ discussions : write
12697 steps :
12798 - uses : actions/download-artifact@v4
12899 with :
129- name : release_dist
100+ name : package_tarballs
101+ path : tarballs
130102
131103 - uses : actions/download-artifact@v4
132104 with :
@@ -151,13 +123,19 @@ jobs:
151123 }" | jq -r '.body')
152124 echo "$release_notes" > release_notes
153125
126+ - name : List files
127+ run : |
128+ ls -l -R dist
129+ ls -l -R tarballs
130+
154131 - name : Create release
155132 uses : softprops/action-gh-release@v2
156133 with :
157134 files : |
158135 dist/*
159136 upstream/*
160- token : ${{ secrets.RELEASE_CREATION_TOKEN }}
137+ tarballs/*
138+ token : ${{ github.ref_type == 'tag' && secrets.RELEASE_CREATION_TOKEN || 'FAIL' }}
161139 body_path : release_notes
162140 prerelease : ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
163141
0 commit comments