1
1
name : CI-CD
2
2
3
3
on :
4
- push :
5
- inputs :
6
- allowDeploy :
7
- description : " Whether to deploy."
8
- required : true
9
- default : true
10
- type : boolean
4
+ push : {}
11
5
pull_request :
12
6
types : [opened, edited, synchronize, reopened]
13
- inputs :
14
- allowDeploy :
15
- description : " Whether to deploy."
16
- required : true
17
- default : true
18
- type : boolean
19
7
workflow_dispatch :
20
8
inputs :
21
9
allowDeploy :
29
17
name : Prepare Matrix
30
18
runs-on : ubuntu-latest
31
19
outputs :
32
- matrix : ${{ steps.set-matrix.outputs.matrix }}
20
+ # Default to a single Linux build.
21
+ matrix : ${{ steps.set-matrix.outputs.matrix || '{"os":["ubuntu-latest"],"cibw_build":"cp39-manylinux_x86_64"}' }}
33
22
steps :
34
23
- uses : actions/checkout@v4.2.2
35
24
94
83
pytest -k 'not TestBeamSearch'; \
95
84
pytest -k '_no_bw or _bw_m1'
96
85
fi
97
- shell : bash
98
86
99
87
build_wheels :
100
88
name : Build wheels
@@ -116,9 +104,11 @@ jobs:
116
104
CIBW_BUILD : ${{ matrix.cibw_build }}
117
105
CIBW_SKIP : ${{ matrix.cibw_skip }}
118
106
CIBW_PROJECT_REQUIRES_PYTHON : " >=3.9"
107
+ CIBW_ARCHS_MACOS : " x86_64 arm64"
119
108
120
109
- uses : actions/upload-artifact@v4
121
110
with :
111
+ name : my-artifact-${{ matrix.os }}
122
112
path : ./wheelhouse/*.whl
123
113
124
114
build_sdist :
@@ -147,7 +137,7 @@ jobs:
147
137
path : dist/*.tar.gz
148
138
149
139
deploy :
150
- if : github.ref == 'refs/heads/master' && ${{ inputs.allowDeploy }} == 'true'
140
+ if : github.ref == 'refs/heads/master' && (github.event_name != 'workflow_dispatch' || inputs.allowDeploy == 'true')
151
141
needs : [build_wheels, build_sdist]
152
142
runs-on : ubuntu-latest
153
143
steps :
@@ -157,8 +147,9 @@ jobs:
157
147
158
148
- uses : actions/download-artifact@v4
159
149
with :
160
- name : artifact
161
150
path : dist
151
+ pattern : my-artifact-*
152
+ merge-multiple : true
162
153
163
154
- name : Publish distribution to PyPI
164
155
uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments