-
Notifications
You must be signed in to change notification settings - Fork 21
69 lines (61 loc) · 1.99 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: deploy
on:
release:
types: [published]
workflow_dispatch: {}
jobs:
build-wheels:
name: Make ${{ matrix.os }} wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@357b80c11e6e995e6297e86386460ae84cbc5bee # v2.18.1
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-*
CIBW_SKIP: '*musllinux*'
CIBW_ARCHS: native
CIBW_BUILD_FRONTEND: build
CIBW_TEST_COMMAND: python {project}/TESTS/unitTests.py
# cross-compilation for Apple Silicon:
# https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile
CIBW_ARCHS_MACOS: x86_64 arm64
- name: Upload wheel as artifact
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}-wheel
path: ./**/*.whl
build-sdist:
name: Make source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: artifact-source-dist
path: ./**/dist/*.tar.gz
deploy:
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Copy artifacts to dist/ folder
run: |
find . -name 'artifact-*' -exec unzip '{}' \;
mkdir -p dist/
find . -name '*.tar.gz' -exec mv '{}' dist/ \;
find . -name '*.whl' -exec mv '{}' dist/ \;
- name: Publish package to test pypi
uses: pypa/gh-action-pypi-publish@68e62d4871ad9d14a9d55f114e6ac71f0b408ec0 # v1.8.14
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}