-
Notifications
You must be signed in to change notification settings - Fork 6
135 lines (116 loc) · 3.79 KB
/
build.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build and Publish
on:
- workflow_dispatch
- workflow_call
jobs:
test_source:
uses: ./.github/workflows/unittest.yml
build_wheels:
needs: test_source
name: Build wheels on ${{ matrix.os }}-${{ matrix.cibw_archs }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest # linux x86_64
cibw_archs: x86_64
cibw_skip: "pp*"
- os: ubuntu-latest # linux arm64 gnu
cibw_archs: aarch64
cibw_skip: "pp* *musllinux*"
- os: ubuntu-latest # linux arm64 musl
cibw_archs: aarch64
cibw_skip: "pp* *manylinux*"
- os: windows-latest
cibw_archs: AMD64 ARM64
cibw_skip: "pp*"
- os: macos-13
cibw_archs: x86_64
cibw_skip: "pp*"
- os: macos-14
cibw_archs: universal2
cibw_skip: "pp*"
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux' && matrix.cibw_archs == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build wheels for ${{ matrix.os }}
uses: pypa/[email protected]
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_BUILD_FRONTEND: build
CIBW_FREE_THREADED_SUPPORT: true
CIBW_SKIP: ${{ matrix.cibw_skip }}
CIBW_ARCHS: ${{ matrix.cibw_archs }}
CIBW_TEST_REQUIRES: "pytest parameterized"
CIBW_TEST_COMMAND: "cd {project}/tests && pytest ."
CIBW_TEST_SKIP: "*-win_arm64 *-musllinux_aarch64"
with:
package-dir: ./
- uses: actions/upload-artifact@v4
with:
name: faster-coco-eval-${{ matrix.os }}-${{ matrix.cibw_archs }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
needs: test_source
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: make sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz
# publish_test:
# needs: [build_wheels, build_sdist]
# name: Publish package to TestPyPI
# runs-on: ubuntu-latest
# # https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#using-an-environment
# environment: release
# # https://github.com/pypa/gh-action-pypi-publish#trusted-publishing
# permissions:
# id-token: write
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: sdist
# path: dist
# - uses: actions/download-artifact@v4
# with:
# name: wheels
# path: dist
# - name: Display structure of downloaded files
# run: ls -R dist
# - name: Publish package distributions to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# publish_prod:
# needs: [publish_test]
# name: Publish package to PyPI
# runs-on: ubuntu-latest
# environment: release
# permissions:
# id-token: write
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: sdist
# path: dist
# - uses: actions/download-artifact@v4
# with:
# name: wheels
# path: dist
# - name: Display structure of downloaded files
# run: ls -R dist
# - name: Publish package distributions to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}