@@ -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
@@ -73,21 +81,53 @@ jobs:
7381 - uses : actions/setup-python@v2
7482
7583 - name : Install Python packages
76- run : python3 -m pip install -U pip setuptools build wheel
84+ run : python -m pip install -U --prefer-binary pip setuptools build wheel twine 'cibuildwheel<3,>=2'
7785
7886 - name : Build source distribution (Linux)
7987 if : runner.os == 'Linux'
80- run : python3 -m build --sdist
88+ id : src-dist
89+ run : |
90+ python -m build --sdist
91+ python -m twine check dist/*
8192
82- - name : Check metadata
93+ - name : Build binary wheels
94+ continue-on-error : true
95+ id : binary-dist
8396 run : |
84- python3 -m pip install twine --prefer-binary
85- python3 -m twine check dist/*
97+ python -m cibuildwheel --output-dir binary_dist
98+ python -m twine check binary_dist/*
99+ env :
100+ CIBW_ARCHS : ${{ matrix.cibw_archs }}
101+
102+ - name : Build binary wheels without (failing) testing
103+ if : steps.binary-dist.outcome == 'failure'
104+ id : failed-dist
105+ run : |
106+ python -m cibuildwheel --output-dir failed_dist
107+ env :
108+ CIBW_ARCHS : ${{ matrix.cibw_archs }}
109+ CIBW_TEST_SKIP : ' *'
86110
87- - uses : actions/upload-artifact@v2
111+ - name : Files for Pypi upload
112+ uses : actions/upload-artifact@v2
113+ if : steps.src-dist.outcome == 'success'
88114 with :
89115 name : pypy_wheels
90- path : ./dist/*
116+ path : ./dist
117+
118+ - name : Binary wheels
119+ uses : actions/upload-artifact@v2
120+ if : steps.binary-dist.outcome == 'success'
121+ with :
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
91131
92132
93133 release :
@@ -142,8 +182,6 @@ jobs:
142182 # ------------------------------------------------------------------------
143183
144184 - uses : actions/download-artifact@v2
145- with :
146- name : pypy_wheels
147185
148186 # Code below inspired from this action:
149187 # - uses: taiki-e/create-gh-release-action@v1
@@ -168,7 +206,9 @@ jobs:
168206 if [[ "${tag}" =~ ^v?[0-9\.]+-[a-zA-Z_0-9\.-]+(\+[a-zA-Z_0-9\.-]+)?$ ]]; then
169207 prerelease="--prerelease"
170208 fi
171- gh release create "v${RELEASE_VERSION}" ${prerelease:-} --title "ProjectQ v${RELEASE_VERSION}" --notes "${notes:-}" pypy_wheels/*
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/*
172212
173213
174214 upload_to_pypi :
@@ -179,8 +219,6 @@ jobs:
179219 - uses : actions/setup-python@v2
180220
181221 - uses : actions/download-artifact@v2
182- with :
183- name : pypy_wheels
184222
185223 - name : Publish standard package
186224 uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments