|
6 | 6 | - v* |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - publish-linux: |
10 | | - runs-on: ubuntu-latest |
| 9 | + cibuildwheel: |
| 10 | + name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.interpreter }} |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + |
| 13 | + defaults: |
| 14 | + run: |
| 15 | + working-directory: ./light-curve |
11 | 16 |
|
12 | 17 | strategy: |
| 18 | + fail-fast: false |
13 | 19 | matrix: |
| 20 | + os: [ubuntu-20.04] |
| 21 | + interpreter: [cp36-manylinux, cp37-manylinux, cp38-manylinux, cp39-manylinux, cp310-manylinux] |
| 22 | + arch: [aarch64, ppc64le] |
14 | 23 | include: |
15 | | - - fftw_feature: mkl |
16 | | - arch: x86_64 |
17 | | - platform: linux/amd64 |
18 | | - - fftw_feature: fftw-static |
19 | | - arch: aarch64 |
20 | | - platform: linux/arm64 |
21 | | - - fftw_feature: fftw-static |
22 | | - arch: ppc64le |
23 | | - platform: linux/ppc64le |
| 24 | + - os: macos-10.15 # All x86_64 macOS targets |
| 25 | + arch: auto |
| 26 | + interpreter: "*" |
| 27 | + - os: ubuntu-20.04 # All i686 and x86_64 Linux targets |
| 28 | + arch: auto |
| 29 | + interpreter: "*" |
24 | 30 |
|
25 | 31 | steps: |
26 | | - - uses: actions/checkout@v3 |
27 | | - - name: Set up QEMU for Docker Buildx |
28 | | - uses: docker/setup-qemu-action@v1 |
29 | | - - name: Build docker image |
30 | | - run: docker buildx build --platform=${{ matrix.platform }} --build-arg='ARCH=${{ matrix.arch }}' --no-cache --tag maturin -f .ci/Dockerfile.maturin .ci |
31 | | - - name: Build wheels |
32 | | - run: docker run --platform=${{ matrix.platform }} --rm -v $(realpath light-curve):/io maturin build --release -i python3.6 -i python3.7 -i python3.8 -i python3.9 -i python3.10 --cargo-extra-args="--locked --no-default-features --features ${{ matrix.fftw_feature }},gsl" |
33 | | - - name: Run Python tests for x86_64 only |
34 | | - if: ${{ matrix.arch == 'x86_64' }} |
35 | | - run: docker run --platform=${{ matrix.platform }} --rm -v $(realpath light-curve):/io --entrypoint=/bin/bash maturin -c 'python3.6 -m pip install target/wheels/*cp36*.whl && python3.7 -m pip install target/wheels/*cp37*.whl && python3.8 -m pip install target/wheels/*cp38*.whl && python3.9 -m pip install target/wheels/*cp39*.whl && python3.10 -m pip install target/wheels/*cp310*.whl && tox -p --skip-pkg-install --sitepackages' |
36 | | - - name: Set up Python |
37 | | - uses: actions/setup-python@v3 |
38 | | - - name: Install twine |
39 | | - run: python3 -mpip install twine |
40 | | - - name: Publish light-curve wheels |
41 | | - run: | |
42 | | - twine check --strict *.whl |
43 | | - twine upload *.whl -u __token__ -p ${{ secrets.PYPI_TOKEN_LIGHT_CURVE }} --verbose |
44 | | - working-directory: light-curve/target/wheels |
45 | | - |
46 | | - publish-macos: |
47 | | - runs-on: macos-10.15 |
| 32 | + - uses: actions/checkout@v2 |
| 33 | + |
| 34 | + - name: Set up QEMU |
| 35 | + if: ${{ matrix.arch != 'auto' }} |
| 36 | + uses: docker/setup-qemu-action@v1 |
| 37 | + with: |
| 38 | + platforms: all |
| 39 | + |
| 40 | + - name: Set CIBW_BUILD |
| 41 | + if: ${{ matrix.arch != 'auto' }} |
| 42 | + run: echo "CIBW_BUILD=${{ matrix.interpreter }}_${{ matrix.arch }}" >> $GITHUB_ENV |
| 43 | + |
| 44 | + - name: Set CIBW_ARCHS |
| 45 | + run : echo "CIBW_ARCHS=${{ matrix.arch }}" >> $GITHUB_ENV |
| 46 | + |
| 47 | + - name: Build wheels |
| 48 | + uses: pypa/cibuildwheel@v2.4.0 |
| 49 | + with: |
| 50 | + package-dir: ./light-curve |
| 51 | + env: |
| 52 | + CIBW_SKIP: "*-musllinux_i686 pp39-*" # rustup doesn't install i686-musl, pyO3<0.16 doesn't support pypy3.9 |
| 53 | + |
| 54 | + - name: Upload wheels as artifacts |
| 55 | + uses: actions/upload-artifact@v2 |
| 56 | + with: |
| 57 | + path: ./wheelhouse/*.whl |
| 58 | + if-no-files-found: error |
| 59 | + |
| 60 | + sdist: |
| 61 | + name: Build source distribution |
| 62 | + runs-on: ubuntu-20.04 |
48 | 63 |
|
49 | 64 | defaults: |
50 | 65 | run: |
51 | | - working-directory: light-curve |
| 66 | + working-directory: ./light-curve |
52 | 67 |
|
53 | 68 | steps: |
54 | | - - uses: actions/checkout@v3 |
55 | | - - name: Set up Python 3.6 |
56 | | - uses: actions/setup-python@v3 |
57 | | - with: |
58 | | - python-version: '3.6' |
59 | | - - name: Set up Python 3.7 |
60 | | - uses: actions/setup-python@v3 |
61 | | - with: |
62 | | - python-version: '3.7' |
63 | | - - name: Set up Python 3.8 |
64 | | - uses: actions/setup-python@v3 |
65 | | - with: |
66 | | - python-version: '3.8' |
67 | | - - name: Set up Python 3.9 |
68 | | - uses: actions/setup-python@v3 |
69 | | - with: |
70 | | - python-version: '3.9' |
71 | | - - name: Set up Python 3.10 |
72 | | - uses: actions/setup-python@v3 |
73 | | - with: |
74 | | - python-version: '3.10' |
75 | | - - name: Set up Rust |
76 | | - uses: actions-rs/toolchain@v1 |
77 | | - with: |
78 | | - toolchain: stable |
79 | | - - name: Install GSL and keep static libs only |
80 | | - run: | |
81 | | - brew install gsl |
82 | | - brew list -v gsl | grep '.dylib' | xargs rm -vf |
83 | | - - name: Install tox and maturin |
84 | | - run: pip install tox maturin |
85 | | - - name: Run Python tests |
86 | | - run: tox -p -q |
87 | | - - name: Publish macOS light-curve packages |
88 | | - run: maturin publish -i python3.6 -i python3.7 -i python3.8 -i python3.9 -i python3.10 -u __token__ -p ${{ secrets.PYPI_TOKEN_LIGHT_CURVE }} |
| 69 | + - uses: actions/checkout@v2 |
| 70 | + |
| 71 | + - name: Setup Python |
| 72 | + uses: actions/setup-python@v3 |
| 73 | + |
| 74 | + - name: Install maturin |
| 75 | + run: pip install maturin |
| 76 | + |
| 77 | + - name: Build sdist |
| 78 | + run: maturin sdist |
| 79 | + |
| 80 | + - name: Upload sdist as an artifact |
| 81 | + uses: actions/upload-artifact@v2 |
| 82 | + with: |
| 83 | + path: ./light-curve/target/wheels/*.tar.gz |
| 84 | + if-no-files-found: error |
| 85 | + |
| 86 | + publish: |
| 87 | + needs: [cibuildwheel, sdist] |
| 88 | + |
| 89 | + name: Publish light-curve |
| 90 | + runs-on: ubuntu-20.04 |
| 91 | + |
| 92 | + steps: |
| 93 | + - uses: actions/download-artifact@v3 |
| 94 | + |
| 95 | + - name: Setup Python |
| 96 | + uses: actions/setup-python@v3 |
| 97 | + |
| 98 | + - name: Install twine |
| 99 | + run: pip install twine |
| 100 | + |
| 101 | + - name: Publish light-curve |
| 102 | + working-directory: artifact |
| 103 | + run: twine upload *whl *tar.gz -u __token__ -p ${{ secrets.PYPI_TOKEN_LIGHT_CURVE }} --verbose |
89 | 104 |
|
90 | 105 | publish-light-curve-python: |
91 | | - runs-on: ubuntu-latest |
| 106 | + needs: publish |
92 | 107 |
|
93 | | - needs: [publish-linux, publish-macos] |
| 108 | + name: Publish light-curve-python |
| 109 | + runs-on: ubuntu-20.04 |
94 | 110 |
|
95 | 111 | defaults: |
96 | 112 | run: |
97 | 113 | working-directory: light-curve-python |
98 | 114 |
|
99 | 115 | steps: |
100 | | - - uses: actions/checkout@v3 |
101 | | - - name: Set up Python |
102 | | - uses: actions/setup-python@v3 |
103 | | - - name: Install deps |
104 | | - run: | |
105 | | - python3 -mpip install -U pip setuptools |
106 | | - python3 -mpip install toml twine |
107 | | - - name: Publish light-curve-python package |
108 | | - run: | |
109 | | - python3 setup.py sdist |
110 | | - twine check --strict dist/* |
111 | | - twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN_LIGHT_CURVE_PYTHON }} --verbose |
| 116 | + - uses: actions/checkout@v2 |
| 117 | + |
| 118 | + - name: Set up Python |
| 119 | + uses: actions/setup-python@v3 |
| 120 | + |
| 121 | + - name: Install deps |
| 122 | + run: python3 -mpip install toml twine |
| 123 | + |
| 124 | + - name: Publish light-curve-python |
| 125 | + run: | |
| 126 | + python3 setup.py sdist |
| 127 | + twine check --strict dist/* |
| 128 | + twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN_LIGHT_CURVE_PYTHON }} --verbose |
0 commit comments