@@ -18,10 +18,18 @@ jobs:
1818 if : startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || github.event_name == 'workflow_dispatch'
1919 strategy :
2020 matrix :
21- os :
22- - ubuntu-latest
23-
21+ cibw_archs : ["auto64"]
22+ os : [ubuntu-latest, windows-latest, macos-latest]
23+ # include:
24+ # - os: ubuntu-18.04
25+ # cibw_archs: "aarch64"
2426 steps :
27+ - name : Set up QEMU
28+ if : matrix.cibw_archs == 'aarch64'
29+ uses : docker/setup-qemu-action@v1
30+ with :
31+ platforms : arm64
32+
2533 - uses : actions/checkout@v2
2634 if : github.event_name != 'workflow_dispatch'
2735
3139 ref : ' master'
3240
3341 - name : Get history and tags for SCM versioning to work
42+ if : ${{ !env.ACT }}
3443 run : |
3544 git fetch --prune --unshallow
3645 git fetch --depth=1 origin +refs/tags/*:refs/tags/*
@@ -69,19 +78,56 @@ jobs:
6978
7079 # ========================================================================
7180
72- - name : Build source distribution
81+ - uses : actions/setup-python@v2
82+
83+ - name : Install Python packages
84+ run : python -m pip install -U --prefer-binary pip setuptools build wheel twine 'cibuildwheel<3,>=2'
85+
86+ - name : Build source distribution (Linux)
7387 if : runner.os == 'Linux'
74- run : python3 setup.py sdist -d wheelhouse
88+ id : src-dist
89+ run : |
90+ python -m build --sdist
91+ python -m twine check dist/*
92+
93+ - name : Build binary wheels
94+ continue-on-error : true
95+ id : binary-dist
96+ run : |
97+ python -m cibuildwheel --output-dir binary_dist
98+ python -m twine check binary_dist/*
99+ env :
100+ CIBW_ARCHS : ${{ matrix.cibw_archs }}
75101
76- - name : Check metadata
102+ - name : Build binary wheels without (failing) testing
103+ if : steps.binary-dist.outcome == 'failure'
104+ id : failed-dist
77105 run : |
78- python3 -m pip install twine --prefer-binary
79- python3 -m twine check wheelhouse/*
106+ python -m cibuildwheel --output-dir failed_dist
107+ env :
108+ CIBW_ARCHS : ${{ matrix.cibw_archs }}
109+ CIBW_TEST_SKIP : ' *'
110+
111+ - name : Files for Pypi upload
112+ uses : actions/upload-artifact@v2
113+ if : steps.src-dist.outcome == 'success'
114+ with :
115+ name : pypy_wheels
116+ path : ./dist
80117
81- - uses : actions/upload-artifact@v2
118+ - name : Binary wheels
119+ uses : actions/upload-artifact@v2
120+ if : steps.binary-dist.outcome == 'success'
82121 with :
83- name : packages
84- path : ./wheelhouse/*
122+ name : wheels
123+ path : ./binary_dist
124+
125+ - name : Binary wheels that failed tests
126+ uses : actions/upload-artifact@v2
127+ if : steps.failed-dist.outcome == 'success'
128+ with :
129+ name : failed_wheels
130+ path : ./failed_dist
85131
86132
87133 release :
@@ -134,7 +180,7 @@ jobs:
134180 ref : ' master'
135181
136182 # ------------------------------------------------------------------------
137- # Downloads all to directories matching the artifact names
183+
138184 - uses : actions/download-artifact@v2
139185
140186 # Code below inspired from this action:
@@ -160,7 +206,9 @@ jobs:
160206 if [[ "${tag}" =~ ^v?[0-9\.]+-[a-zA-Z_0-9\.-]+(\+[a-zA-Z_0-9\.-]+)?$ ]]; then
161207 prerelease="--prerelease"
162208 fi
163- gh release create "v${RELEASE_VERSION}" ${prerelease:-} --title "ProjectQ v${RELEASE_VERSION}" --notes "${notes:-}" packages/*
209+
210+ mkdir -p wheels pypy_wheels
211+ gh release create "v${RELEASE_VERSION}" ${prerelease:-} --title "ProjectQ v${RELEASE_VERSION}" --notes "${notes:-}" pypy_wheels/* wheels/*
164212
165213
166214 upload_to_pypi :
@@ -170,15 +218,14 @@ jobs:
170218 steps :
171219 - uses : actions/setup-python@v2
172220
173- # Downloads all to directories matching the artifact names
174221 - uses : actions/download-artifact@v2
175222
176223 - name : Publish standard package
177224 uses : pypa/gh-action-pypi-publish@release/v1
178225 with :
179226 user : __token__
180227 password : ${{ secrets.pypi_password }}
181- packages_dir : packages /
228+ packages_dir : pypy_wheels /
182229
183230 master_to_develop_pr :
184231 name : Merge master back into develop
@@ -188,7 +235,7 @@ jobs:
188235 - upload_to_pypi
189236 steps :
190237 - name : Merge master into develop branch
191- uses : thomaseizinger/create-pull-request@1.1.0
238+ uses : thomaseizinger/create-pull-request@1.2.2
192239 env :
193240 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
194241 with :
0 commit comments