Skip to content

Commit 2963e32

Browse files
authored
Updated Github Actions (#67)
* Some potential improvements to the workflow * Specifying ARM arch for macos * Upped setuptools version to protect against url injections
1 parent 56b7f84 commit 2963e32

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

.github/workflows/build_deploy.yml

+8-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
name: CI-CD
22

33
on:
4-
push:
5-
inputs:
6-
allowDeploy:
7-
description: "Whether to deploy."
8-
required: true
9-
default: true
10-
type: boolean
4+
push: {}
115
pull_request:
126
types: [opened, edited, synchronize, reopened]
13-
inputs:
14-
allowDeploy:
15-
description: "Whether to deploy."
16-
required: true
17-
default: true
18-
type: boolean
197
workflow_dispatch:
208
inputs:
219
allowDeploy:
@@ -29,7 +17,8 @@ jobs:
2917
name: Prepare Matrix
3018
runs-on: ubuntu-latest
3119
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"}' }}
3322
steps:
3423
- uses: actions/checkout@v4.2.2
3524

@@ -94,7 +83,6 @@ jobs:
9483
pytest -k 'not TestBeamSearch'; \
9584
pytest -k '_no_bw or _bw_m1'
9685
fi
97-
shell: bash
9886
9987
build_wheels:
10088
name: Build wheels
@@ -116,9 +104,11 @@ jobs:
116104
CIBW_BUILD: ${{ matrix.cibw_build }}
117105
CIBW_SKIP: ${{ matrix.cibw_skip }}
118106
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
107+
CIBW_ARCHS_MACOS: "x86_64 arm64"
119108

120109
- uses: actions/upload-artifact@v4
121110
with:
111+
name: my-artifact-${{ matrix.os }}
122112
path: ./wheelhouse/*.whl
123113

124114
build_sdist:
@@ -147,7 +137,7 @@ jobs:
147137
path: dist/*.tar.gz
148138

149139
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')
151141
needs: [build_wheels, build_sdist]
152142
runs-on: ubuntu-latest
153143
steps:
@@ -157,8 +147,9 @@ jobs:
157147

158148
- uses: actions/download-artifact@v4
159149
with:
160-
name: artifact
161150
path: dist
151+
pattern: my-artifact-*
152+
merge-multiple: true
162153

163154
- name: Publish distribution to PyPI
164155
uses: pypa/gh-action-pypi-publish@release/v1

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pybind11==2.11.1
77
pytest==7.4.0
88
pytest-order==1.1.0
99
seaborn==0.12.2
10-
setuptools==68.0.0
10+
setuptools==75.8.0
1111
sphinx==7.0.1
1212
twine>=4.0.2
1313
wheel==0.40.0

0 commit comments

Comments
 (0)