Skip to content

Commit c7bba78

Browse files
authored
[Deploy] Updating deployment workflow (#811)
Working in the build mines: - Drop 32-bit support; it seems unlikely that many models will load on such machines - Update all actions - Create a single combined artifact - Re-enable publishing, conditional on a tag
1 parent 56ab69e commit c7bba78

File tree

1 file changed

+45
-37
lines changed

1 file changed

+45
-37
lines changed

.github/workflows/pypi_upload.yml

Lines changed: 45 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ jobs:
1717
outputs:
1818
include: ${{ steps.set-matrix.outputs.include }}
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- name: Install cibuildwheel
2222
# Nb. keep cibuildwheel version pin consistent with job below
23-
run: pipx install cibuildwheel==2.14.0
23+
run: pipx install cibuildwheel==2.17.0
2424
- id: set-matrix
2525
run: |
2626
MATRIX=$(
2727
{
28-
cibuildwheel --print-build-identifiers --platform linux \
28+
cibuildwheel --print-build-identifiers --platform linux --archs x86_64 \
2929
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
30-
&& cibuildwheel --print-build-identifiers --platform macos \
30+
&& cibuildwheel --print-build-identifiers --platform macos --archs x86_64 \
31+
| jq -nRc '{"only": inputs, "os": "macos-12"}' \
32+
&& cibuildwheel --print-build-identifiers --platform macos --archs arm64 \
3133
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \
32-
# && cibuildwheel --print-build-identifiers --platform windows \
33-
# | jq -nRc '{"only": inputs, "os": "windows-latest"}'
34+
&& cibuildwheel --print-build-identifiers --platform windows --archs auto64 \
35+
| jq -nRc '{"only": inputs, "os": "windows-latest"}'
3436
} | jq -sc
3537
)
3638
echo "include=$MATRIX" >> $GITHUB_OUTPUT
@@ -51,7 +53,7 @@ jobs:
5153

5254
steps:
5355
- name: Check out the repo
54-
uses: actions/checkout@v3
56+
uses: actions/checkout@v4
5557

5658
- name: Install Rust
5759
shell: bash
@@ -61,29 +63,29 @@ jobs:
6163
6264
- name: Set up QEMU
6365
if: runner.os == 'Linux'
64-
uses: docker/setup-qemu-action@v2
66+
uses: docker/setup-qemu-action@v3
6567
with:
6668
platforms: all
6769

6870
- name: Build wheels
69-
uses: pypa/cibuildwheel@v2.14.0
71+
uses: pypa/cibuildwheel@v2.17.0
7072
with:
7173
only: ${{ matrix.only }}
7274

73-
- uses: actions/upload-artifact@v3
75+
- uses: actions/upload-artifact@v4
7476
with:
7577
path: ./wheelhouse/*.whl
76-
name: bdist_files
78+
name: bdist_files_${{ matrix.os }}_${{ strategy.job-index }}
7779

7880
build_sdist:
7981
name: Build source distribution
8082
runs-on: ubuntu-20.04
8183
steps:
8284
- name: Check out the repo
83-
uses: actions/checkout@v3
85+
uses: actions/checkout@v4
8486

8587
- name: Set up Python 3.11
86-
uses: actions/setup-python@v4
88+
uses: actions/setup-python@v5
8789
with:
8890
python-version: '3.11'
8991

@@ -104,31 +106,37 @@ jobs:
104106
python -m build --sdist
105107
106108
- name: Upload sdist
107-
uses: actions/upload-artifact@v3
109+
uses: actions/upload-artifact@v4
108110
with:
109111
name: sdist_files
110112
path: dist/*.tar.gz
111113

112-
# publish_wheels:
113-
# permissions:
114-
# id-token: write
115-
# name: Publish wheels on pypi
116-
# needs: [build_wheels, build_sdist]
117-
# runs-on: ubuntu-latest
118-
# if: startsWith(github.ref, 'refs/tags')
119-
# steps:
120-
# - uses: actions/download-artifact@v3
121-
# with:
122-
# name: bdist_files
123-
# path: dist
124-
125-
# - uses: actions/download-artifact@v3
126-
# with:
127-
# name: sdist_files
128-
# path: dist
129-
130-
# - name: Publish package to PyPI
131-
# uses: pypa/gh-action-pypi-publish@release/v1
132-
# with:
133-
# user: __token__
134-
# password: ${{ secrets.PYPI_API_TOKEN }}
114+
publish_wheels:
115+
permissions:
116+
id-token: write
117+
name: Publish wheels on pypi
118+
needs: [build_wheels, build_sdist]
119+
runs-on: ubuntu-latest
120+
steps:
121+
- uses: actions/download-artifact@v4
122+
with:
123+
pattern: bdist_files_*
124+
merge-multiple: true
125+
path: dist
126+
127+
- uses: actions/download-artifact@v4
128+
with:
129+
name: sdist_files
130+
path: dist
131+
132+
- uses: actions/upload-artifact@v4
133+
with:
134+
path: ./dist/*
135+
name: collected_dist_files
136+
137+
- name: Publish package to PyPI
138+
uses: pypa/gh-action-pypi-publish@release/v1
139+
if: startsWith(github.ref, 'refs/tags')
140+
with:
141+
user: __token__
142+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)