|
1 | | -name: Python package build and publish |
| 1 | +name: Build |
2 | 2 |
|
3 | | -on: |
4 | | - push: |
5 | | - tags: |
6 | | - - 'v*' |
| 3 | +on: [push, pull_request] |
7 | 4 |
|
8 | 5 | jobs: |
9 | | - deploy: |
| 6 | + build_wheels: |
| 7 | + name: Build wheels on ${{ matrix.os }} |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + os: [ubuntu-latest, windows-latest, macos-12, macos-13, macos-14] |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + submodules: true |
| 17 | + |
| 18 | + - name: Set up QEMU |
| 19 | + if: runner.os == 'Linux' |
| 20 | + uses: docker/setup-qemu-action@v3 |
| 21 | + with: |
| 22 | + platforms: all |
| 23 | + |
| 24 | + - name: Build wheels |
| 25 | + |
| 26 | + env: |
| 27 | + CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x |
| 28 | + CIBW_ARCHS_WINDOWS: all |
| 29 | + |
| 30 | + - uses: actions/upload-artifact@v4 |
| 31 | + with: |
| 32 | + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 33 | + path: ./wheelhouse/*.whl |
| 34 | + |
| 35 | + make_sdist: |
| 36 | + name: Make SDist |
10 | 37 | runs-on: ubuntu-latest |
11 | 38 | steps: |
12 | | - - uses: actions/checkout@v2 |
13 | | - - name: Set up Python |
14 | | - uses: actions/setup-python@v1 |
15 | | - with: |
16 | | - python-version: 3.8 |
17 | | - - name: Build manylinux Python wheels |
18 | | - uses: RalfG/[email protected]_x86_64 |
19 | | - with: |
20 | | - python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39' |
21 | | - build-requirements: 'scikit-build' |
22 | | - system-packages: 'python3-tkinter fontconfig-devel fontconfig cmake gcc gcc-c++ make pkgconfig tcl tcl-devel tk tk-devel' |
23 | | - package-path: '.' |
24 | | - - name: Update wheel ownership |
25 | | - run: | |
26 | | - sudo chown $USER:$USER dist/* |
27 | | - - name: Post-process manylinux wheels |
28 | | - run: | |
29 | | - sudo python ci/post_process_manylinux.py |
30 | | - - name: Create Release |
31 | | - uses: ncipollo/release-action@v1 |
32 | | - with: |
33 | | - allowUpdates: true |
34 | | - omitBody: true |
35 | | - token: ${{ secrets.DEPLOY_TOKEN }} |
36 | | - - name: Upload binaries to release |
37 | | - uses: svenstaro/upload-release-action@v2 |
38 | | - with: |
39 | | - repo_token: ${{ secrets.DEPLOY_TOKEN }} |
40 | | - file: dist/*-manylinux*.whl |
41 | | - tag: ${{ github.ref }} |
42 | | - overwrite: true |
43 | | - file_glob: true |
44 | | - - name: PyPI Dispatch |
45 | | - uses: peter-evans/repository-dispatch@v1 |
46 | | - with: |
47 | | - token: ${{ secrets.DEPLOY_TOKEN }} |
48 | | - repository: TkinterEP/python-tkextrafont |
49 | | - event-type: pypi-upload |
50 | | - client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' |
| 39 | + - uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + submodules: true |
| 42 | + |
| 43 | + - name: Build SDist |
| 44 | + run: pipx run build --sdist |
| 45 | + |
| 46 | + - uses: actions/upload-artifact@v4 |
| 47 | + with: |
| 48 | + name: cibw-sdist |
| 49 | + path: dist/*.tar.gz |
| 50 | + |
| 51 | + upload_all: |
| 52 | + needs: [build_wheels, make_sdist] |
| 53 | + environment: pypi |
| 54 | + permissions: |
| 55 | + id-token: write |
| 56 | + runs-on: ubuntu-latest |
| 57 | + if: github.event_name == 'release' && github.event.action == 'published' |
| 58 | + steps: |
| 59 | + - uses: actions/download-artifact@v4 |
| 60 | + with: |
| 61 | + pattern: cibw-* |
| 62 | + path: dist |
| 63 | + merge-multiple: true |
| 64 | + |
| 65 | + - uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments