@@ -17,27 +17,53 @@ concurrency:
17
17
cancel-in-progress : true
18
18
19
19
jobs :
20
- # The job to build pypi wheels users can installed precompiled for them.
21
- # At the moment only linux wheels are build, Windows and MacOS will compile on installation
22
- # Before prebuilds all users had to compile code anyway.
23
- build :
20
+ # The job to build precompiled pypi wheels.
21
+ make_sdist :
22
+ name : Make SDist
23
+ runs-on : ubuntu-latest
24
+ steps :
25
+ - uses : actions/checkout@v3
26
+ with :
27
+ submodules : true
28
+
29
+ - name : Build SDist
30
+ run : pipx run build --sdist
31
+
32
+ - uses : actions/upload-artifact@v3
33
+ with :
34
+ path : dist/*.tar.gz
35
+
36
+ build_wheels :
37
+ name : Build ${{ matrix.python-version }} wheels on ${{ matrix.platform }}
38
+ runs-on : ${{ matrix.platform }}
24
39
strategy :
25
40
matrix :
26
- python-version : ["3.7", "3.8", "3.9", "3.10"]
27
- name : Build source distribution
28
- runs-on : ubuntu-latest
41
+ platform :
42
+ - macos-12
43
+ - windows-2022
44
+ - ubuntu-20.04
29
45
steps :
30
46
- uses : actions/checkout@v3
31
47
with :
32
48
fetch-depth : 0
33
- - uses : actions/setup-python@v4
49
+
50
+ - name : Build wheels
51
+
52
+
53
+ - uses : actions/upload-artifact@v3
34
54
with :
35
- python-version : ${{ matrix.python-version }}
36
- - name : Build the sdist and the wheel
37
- run : |
38
- pip install build
39
- python -m build
40
- - name : Check the sdist installs and imports
55
+ path : ./wheelhouse/*.whl
56
+
57
+ check_dist :
58
+ name : Check dist
59
+ needs : [make_sdist,build_wheels]
60
+ runs-on : ubuntu-22.04
61
+ steps :
62
+ - uses : actions/download-artifact@v3
63
+ with :
64
+ name : artifact
65
+ path : dist
66
+ - name : Check SDist
41
67
run : |
42
68
mkdir -p test-sdist
43
69
cd test-sdist
@@ -47,32 +73,21 @@ jobs:
47
73
venv-sdist/bin/python -c "import pytensor;print(pytensor.__version__)"
48
74
# check import cython module
49
75
venv-sdist/bin/python -c 'from pytensor.scan import scan_perform; print(scan_perform.get_version())'
50
- - name : Check the bdist installs and imports
51
- run : |
52
- mkdir -p test-bdist
53
- cd test-bdist
54
- python -m venv venv-bdist
55
- venv-bdist/bin/python -m pip install ../dist/pytensor-*.whl
56
- # check import
57
- venv-bdist/bin/python -c "import pytensor;print(pytensor.__version__)"
58
- # check import cython module
59
- venv-bdist/bin/python -c 'from pytensor.scan import scan_perform; print(scan_perform.get_version())'
60
- - uses : actions/upload-artifact@v3
61
- with :
62
- name : artifact
63
- path : dist/*
76
+
77
+ - run : pipx run twine check --strict dist/*
64
78
65
79
upload_pypi :
66
80
name : Upload to PyPI on release
67
- needs : [build ]
81
+ needs : [check_dist ]
68
82
runs-on : ubuntu-latest
69
83
if : github.event_name == 'release' && github.event.action == 'published'
70
84
steps :
71
- - uses : actions/download-artifact@v3
72
- with :
73
- name : artifact
74
- path : dist
75
-
76
- with :
77
- user : __token__
78
- password : ${{ secrets.pypi_secret }}
85
+ - uses : actions/download-artifact@v3
86
+ with :
87
+ name : artifact
88
+ path : dist
89
+
90
+
91
+ with :
92
+ user : __token__
93
+ password : ${{ secrets.pypi_password }}
0 commit comments