1- name : " release "
1+ name : " Release "
22on :
33 release :
44 types : [published]
55 workflow_dispatch :
66permissions :
77 contents : read
88jobs :
9- build-ubuntu :
10- name : Build ubuntu-20.04
11- runs-on : ubuntu-20 .04
9+ build-ubuntu-extension :
10+ name : Build ubuntu
11+ runs-on : ubuntu-18 .04
1212 steps :
1313 - uses : actions/checkout@v2
1414 - uses : actions/cache@v3
2929 with :
3030 name : sqlite-regex-ubuntu
3131 path : dist/release/regex0.so
32- build-macos :
32+ build-ubuntu-python :
33+ runs-on : ubuntu-18.04
34+ needs : [build-ubuntu-extension]
35+ steps :
36+ - uses : actions/checkout@v3
37+ - name : Download workflow artifacts
38+ uses : actions/download-artifact@v3
39+ with :
40+ name : sqlite-regex-ubuntu
41+ path : dist/release/
42+ - uses : actions/setup-python@v3
43+ - run : pip install wheel
44+ - run : make python-release
45+ - run : make datasette-release
46+ - uses : actions/upload-artifact@v3
47+ with :
48+ name : sqlite-regex-ubuntu-wheels
49+ path : dist/release/wheels/*.whl
50+ build-macos-extension :
3351 name : Build macos-latest
3452 runs-on : macos-latest
3553 steps :
5270 with :
5371 name : sqlite-regex-macos
5472 path : dist/release/regex0.dylib
55- build-macos-arm :
73+ build-macos-python :
74+ runs-on : macos-latest
75+ needs : [build-macos-extension]
76+ steps :
77+ - uses : actions/checkout@v3
78+ - name : Download workflow artifacts
79+ uses : actions/download-artifact@v3
80+ with :
81+ name : sqlite-regex-macos
82+ path : dist/release/
83+ - uses : actions/setup-python@v3
84+ - run : pip install wheel
85+ - run : make python-release
86+ - run : make datasette-release
87+ - uses : actions/upload-artifact@v3
88+ with :
89+ name : sqlite-regex-macos-wheels
90+ path : dist/release/wheels/*.whl
91+ build-macos-arm-extension :
5692 name : Build macos-latest with arm
5793 runs-on : macos-latest
5894 steps :
@@ -70,14 +106,31 @@ jobs:
70106 with :
71107 toolchain : stable
72108 - run : rustup target add aarch64-apple-darwin
73- - run : make target=aarch64-apple-darwin loadable
74- # - run: make test
109+ - run : make loadable-release target=aarch64-apple-darwin
75110 - name : Upload artifacts
76111 uses : actions/upload-artifact@v3
77112 with :
78113 name : sqlite-regex-macos-arm
79- path : dist/debug/regex0.dylib
80- build-windows :
114+ path : dist/release/regex0.dylib
115+ build-macos-arm-python :
116+ runs-on : macos-latest
117+ needs : [build-macos-arm-extension]
118+ steps :
119+ - uses : actions/checkout@v3
120+ - name : Download workflow artifacts
121+ uses : actions/download-artifact@v3
122+ with :
123+ name : sqlite-regex-macos-arm
124+ path : dist/release/
125+ - uses : actions/setup-python@v3
126+ - run : pip install wheel
127+ - run : make python-release IS_MACOS_ARM=1
128+ - run : make datasette-release
129+ - uses : actions/upload-artifact@v3
130+ with :
131+ name : sqlite-regex-macos-arm-wheels
132+ path : dist/release/wheels/*.whl
133+ build-windows-extension :
81134 name : Build windows-latest
82135 runs-on : windows-latest
83136 steps :
@@ -100,19 +153,74 @@ jobs:
100153 with :
101154 name : sqlite-regex-windows
102155 path : dist/release/regex0.dll
103- upload :
104- name : upload
105- needs : [build-macos, build-macos-arm, build-ubuntu, build-windows]
156+ build-windows-python :
157+ runs-on : windows-latest
158+ needs : [build-windows-extension]
159+ steps :
160+ - uses : actions/checkout@v3
161+ - name : Download workflow artifacts
162+ uses : actions/download-artifact@v3
163+ with :
164+ name : sqlite-regex-windows
165+ path : dist/release/
166+ - uses : actions/setup-python@v3
167+ - run : pip install wheel
168+ - run : make python-release
169+ - run : make datasette-release
170+ - uses : actions/upload-artifact@v3
171+ with :
172+ name : sqlite-regex-windows-wheels
173+ path : dist/release/wheels/*.whl
174+ upload-release-assets :
175+ name : Upload release assets
176+ needs :
177+ [
178+ build-macos-extension,
179+ build-macos-arm-extension,
180+ build-ubuntu-extension,
181+ build-windows-extension,
182+ ]
106183 permissions :
107184 contents : write
108185 runs-on : ubuntu-latest
109186 steps :
110187 - uses : actions/checkout@v2
111188 - name : Download workflow artifacts
112189 uses : actions/download-artifact@v2
190+ - run : npm install tar-fs
113191 - uses : actions/github-script@v6
114192 with :
115193 github-token : ${{ secrets.GITHUB_TOKEN }}
116194 script : |
117195 const script = require('.github/workflows/upload.js')
118196 await script({github, context})
197+ upload_pypi :
198+ needs :
199+ [
200+ build-ubuntu-python,
201+ build-macos-python,
202+ build-macos-arm-python,
203+ build-windows-python,
204+ ]
205+ runs-on : ubuntu-latest
206+ steps :
207+ - uses : actions/download-artifact@v3
208+ with :
209+ name : sqlite-regex-windows-wheels
210+ path : dist
211+ - uses : actions/download-artifact@v3
212+ with :
213+ name : sqlite-regex-ubuntu-wheels
214+ path : dist
215+ - uses : actions/download-artifact@v3
216+ with :
217+ name : sqlite-regex-macos-wheels
218+ path : dist
219+ - uses : actions/download-artifact@v3
220+ with :
221+ name : sqlite-regex-macos-arm-wheels
222+ path : dist
223+ - uses : pypa/gh-action-pypi-publish@release/v1
224+ with :
225+ password : ${{ secrets.PYPI_API_TOKEN }}
226+ skip_existing : true
0 commit comments