Skip to content

Commit 21a588d

Browse files
committed
Update github action
1 parent 0dac43c commit 21a588d

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ jobs:
2323
pip install Pillow pytest
2424
pytest
2525
26-
- uses: actions/upload-artifact@v3
26+
- uses: actions/upload-artifact@v4
2727
with:
28+
name: sdist
2829
path: dist/*.tar.gz
30+
retention-days: 7
2931

3032
build_wheels:
3133
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
@@ -46,7 +48,7 @@ jobs:
4648
arch: arm64
4749
cibw_archs_windows: ARM64
4850
cibw_build: "cp39*"
49-
- os: macos-12
51+
- os: macos-13
5052
arch: x64
5153
cibw_archs_macos: x86_64
5254
cibw_build: "cp37* pp*"
@@ -58,23 +60,23 @@ jobs:
5860
arch: arm64
5961
cibw_archs_macos: arm64
6062
cibw_build: "cp38* pp*"
61-
- os: ubuntu-20.04
63+
- os: ubuntu-22.04
6264
arch: x64
6365
cibw_archs_linux: x86_64
6466
cibw_build: "cp37* pp*"
65-
- os: ubuntu-20.04
67+
- os: ubuntu-22.04
6668
arch: x86
6769
cibw_archs_linux: i686
6870
cibw_build: "cp37* pp*"
69-
- os: ubuntu-20.04
71+
- os: ubuntu-22.04-arm
7072
arch: arm64
7173
cibw_archs_linux: aarch64
7274
cibw_build: "cp37* pp*"
73-
- os: ubuntu-20.04
75+
- os: ubuntu-22.04
7476
arch: ppc64le
7577
cibw_archs_linux: ppc64le
7678
cibw_build: "cp37*"
77-
- os: ubuntu-20.04
79+
- os: ubuntu-22.04
7880
arch: s390x
7981
cibw_archs_linux: s390x
8082
cibw_build: "cp37*"
@@ -115,42 +117,48 @@ jobs:
115117
pip install abi3audit
116118
abi3audit $(ls ./wheelhouse/*.whl) --debug --verbose
117119
118-
- uses: actions/upload-artifact@v3
120+
- uses: actions/upload-artifact@v4
119121
with:
122+
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
120123
path: ./wheelhouse/*.whl
124+
retention-days: 7
121125

122126
upload_pypi_test:
123127
needs: [build_wheels, build_sdist]
124128
runs-on: ubuntu-latest
125129
# upload to PyPI on every tag starting with 'v'
126130
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
127131
steps:
128-
- uses: actions/download-artifact@v3
129-
with:
130-
# unpacks default artifact into dist/
131-
# if `name: artifact` is omitted, the action will create extra parent dir
132-
name: artifact
133-
path: dist
132+
- name: "Download artifacts"
133+
uses: actions/download-artifact@v4
134+
135+
- name: "Move packages to the dist/ folder"
136+
run: |
137+
mkdir dist/
138+
mv sdist/* dist/
139+
mv wheels-*/*.whl dist/
134140
135-
- uses: pypa/gh-action-pypi-publish@v1.5.0
141+
- name: "Publish packages on PyPI"
142+
uses: pypa/gh-action-pypi-publish@v1.5.0
136143
with:
137-
user: __token__
138-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
144+
password: ${{ secrets.PYPI_API_TOKEN }}
139145
repository_url: https://test.pypi.org/legacy/
140146

141147
upload_pypi:
142148
needs: [build_wheels, build_sdist]
143149
runs-on: ubuntu-latest
144150
if: github.event_name == 'release' && github.event.action == 'published'
145151
steps:
146-
- uses: actions/download-artifact@v3
147-
with:
148-
# unpacks default artifact into dist/
149-
# if `name: artifact` is omitted, the action will create extra parent dir
150-
name: artifact
151-
path: dist
152+
- name: "Download artifacts"
153+
uses: actions/download-artifact@v4
154+
155+
- name: "Move packages to the dist/ folder"
156+
run: |
157+
mkdir dist/
158+
mv sdist/* dist/
159+
mv wheels-*/*.whl dist/
152160
153-
- uses: pypa/gh-action-pypi-publish@v1.5.0
161+
- name: "Publish packages on PyPI"
162+
uses: pypa/gh-action-pypi-publish@v1.5.0
154163
with:
155-
user: __token__
156164
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)