Skip to content

Commit f97fb48

Browse files
committed
ci: upgrade actions
1 parent f0e5dc6 commit f97fb48

2 files changed

Lines changed: 93 additions & 104 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 28 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@
33
# https://github.com/actions
44
# https://cibuildwheel.readthedocs.io/en/stable/options/
55
#
6-
# uses: https://github.com/actions/checkout @v4
7-
# uses: https://github.com/actions/setup-python @v4
8-
# uses: https://github.com/actions/download-artifact @v3
9-
# uses: https://github.com/actions/upload-artifact @v3
10-
# uses: https://github.com/pypa/cibuildwheel @v2.16
116

127
name: CI
138

149
on:
1510
pull_request: {}
16-
push: {}
1711

1812
jobs:
1913

@@ -23,17 +17,16 @@ jobs:
2317
strategy:
2418
matrix:
2519
test:
26-
- {PY: "3.10", TOXENV: "lint"}
20+
- {PY: "3.14", TOXENV: "lint"}
2721
steps:
2822
- name: "Checkout"
29-
uses: actions/checkout@v4
23+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3024

3125
- name: "Setup Python ${{matrix.test.PY}}"
32-
uses: actions/setup-python@v4
26+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3327
with:
3428
python-version: ${{matrix.test.PY}}
35-
36-
- run: python3 -m pip install -r etc/requirements.build.txt --disable-pip-version-check
29+
pip-install: -r etc/requirements.build.txt
3730

3831
- name: "Test"
3932
env:
@@ -46,35 +39,24 @@ jobs:
4639
strategy:
4740
matrix:
4841
test:
49-
- {os: "ubuntu-latest", osname: "Linux", PY: "3.7", TOXENV: "py37", arch: "x64"}
50-
- {os: "ubuntu-latest", osname: "Linux", PY: "3.8", TOXENV: "py38", arch: "x64"}
51-
- {os: "ubuntu-latest", osname: "Linux", PY: "3.9", TOXENV: "py39", arch: "x64"}
5242
- {os: "ubuntu-latest", osname: "Linux", PY: "3.10", TOXENV: "py310", arch: "x64"}
53-
- {os: "ubuntu-latest", osname: "Linux", PY: "3.11", TOXENV: "py311", arch: "x64"}
54-
- {os: "ubuntu-latest", osname: "Linux", PY: "3.12", TOXENV: "py312", arch: "x64"}
55-
- {os: "macos-latest", osname: "MacOS", PY: "3.10", TOXENV: "py310", arch: "x64"}
56-
- {os: "macos-latest", osname: "MacOS", PY: "3.11", TOXENV: "py311", arch: "x64"}
57-
#- {os: "macos-latest", osname: "MacOS", PY: "3.12", TOXENV: "py312", arch: "x64"}
58-
- {os: "windows-latest", osname: "Windows", PY: "3.7", TOXENV: "py37", arch: "x86"}
59-
- {os: "windows-latest", osname: "Windows", PY: "3.8", TOXENV: "py38", arch: "x64"}
60-
- {os: "windows-latest", osname: "Windows", PY: "3.10", TOXENV: "py310", arch: "x86"}
61-
- {os: "windows-latest", osname: "Windows", PY: "3.11", TOXENV: "py311", arch: "x64"}
62-
#- {os: "windows-latest", osname: "Windows", PY: "3.12", TOXENV: "py312", arch: "x64"}
63-
- {os: "ubuntu-latest", osname: "Linux", PY: "pypy3.8", TOXENV: "pypy38", arch: "x64"}
64-
- {os: "ubuntu-latest", osname: "Linux", PY: "pypy3.9", TOXENV: "pypy39", arch: "x64"}
65-
- {os: "ubuntu-latest", osname: "Linux", PY: "pypy3.10", TOXENV: "pypy310", arch: "x64"}
43+
- {os: "ubuntu-latest", osname: "Linux", PY: "3.13", TOXENV: "py313", arch: "x64"}
44+
- {os: "ubuntu-latest", osname: "Linux", PY: "3.14", TOXENV: "py314", arch: "x64"}
45+
- {os: "macos-latest", osname: "MacOS", PY: "3.12", TOXENV: "py312", arch: "x64"}
46+
- {os: "macos-latest", osname: "MacOS", PY: "3.14", TOXENV: "py314", arch: "arm64"}
47+
- {os: "windows-latest", osname: "Windows", PY: "3.13", TOXENV: "py313", arch: "x64"}
48+
- {os: "windows-latest", osname: "Windows", PY: "3.14", TOXENV: "py314", arch: "x64"}
49+
#- {os: "ubuntu-latest", osname: "Linux", PY: "pypy3.11", TOXENV: "pypy311", arch: "x64"}
6650
steps:
67-
- name: "Checkout"
68-
uses: actions/checkout@v4
51+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
6952

7053
- name: "Setup Python ${{matrix.test.PY}}"
71-
uses: actions/setup-python@v4
54+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
7255
with:
7356
python-version: ${{matrix.test.PY}}
7457
architecture: ${{matrix.test.arch}}
7558
allow-prereleases: true
76-
77-
- run: python3 -m pip install -r etc/requirements.build.txt --disable-pip-version-check
59+
pip-install: -r etc/requirements.build.txt
7860

7961
- name: "Build"
8062
run: python setup.py build
@@ -90,23 +72,18 @@ jobs:
9072
strategy:
9173
matrix:
9274
test:
93-
- {PY: "3.7", PG: "11", TOXENV: "py37"}
94-
- {PY: "3.8", PG: "12", TOXENV: "py38"}
95-
- {PY: "3.9", PG: "13", TOXENV: "py39"}
96-
- {PY: "3.10", PG: "14", TOXENV: "py310"}
97-
- {PY: "3.11", PG: "15", TOXENV: "py311"}
75+
- {PY: "3.10", PG: "16", TOXENV: "py310"}
76+
- {PY: "3.14", PG: "18", TOXENV: "py314"}
9877
#- {PY: "pypy3.9", PG: "15", TOXENV: "pypy39"}
9978
#- {PY: "pypy3.10", PG: "15", TOXENV: "pypy310"}
10079
steps:
101-
- name: "Checkout"
102-
uses: actions/checkout@v4
80+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
10381

10482
- name: "Setup Python ${{matrix.test.PY}}"
105-
uses: actions/setup-python@v4
83+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
10684
with:
10785
python-version: ${{matrix.test.PY}}
108-
109-
- run: python3 -m pip install -r etc/requirements.build.txt --disable-pip-version-check
86+
pip-install: -r etc/requirements.build.txt
11087

11188
- name: "InstallDB"
11289
run: |
@@ -162,27 +139,20 @@ jobs:
162139
strategy:
163140
matrix:
164141
sys:
165-
- {os: "ubuntu-latest", name: "Linux", archs: "auto", qemu: false}
166-
- {os: "ubuntu-latest", name: "Linux", archs: "aarch64", qemu: true}
167-
- {os: "macos-latest", name: "MacOS", archs: "x86_64 arm64 universal2", qemu: false}
168-
- {os: "windows-latest", name: "Windows", archs: "auto", qemu: false}
142+
- {os: "ubuntu-latest", name: "Linux", archs: "auto"}
143+
- {os: "ubuntu-24.04-arm", name: "Linux", archs: "aarch64"}
144+
- {os: "macos-15-intel", name: "MacOS", archs: "x86_64 universal2"}
145+
- {os: "macos-latest", name: "MacOS", archs: "auto"}
146+
- {os: "windows-latest", name: "Windows", archs: "auto"}
169147
steps:
170-
- uses: actions/checkout@v4
171-
- name: "Set up QEMU"
172-
if: ${{matrix.sys.qemu}}
173-
uses: docker/setup-qemu-action@v2
174-
with:
175-
platforms: all
176-
- uses: pypa/cibuildwheel@v2.16
148+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
149+
- uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
177150
env:
178151
CIBW_ARCHS: "${{matrix.sys.archs}}"
179-
# cp38: cp37-macos does not support universal2/arm64
180-
CIBW_BUILD: "cp38-* pp*-manylinux_x86_64"
181-
CIBW_SKIP: "pp37-*"
182152
- name: "Check"
183153
shell: bash
184154
run: |
185155
ls -l wheelhouse
186-
- uses: actions/upload-artifact@v3
187-
with: {name: "dist", path: "wheelhouse"}
156+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
157+
with: {name: "wheel-${{matrix.sys.os}}", path: "wheelhouse"}
188158

‎.github/workflows/release.yml‎

Lines changed: 65 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,62 @@ jobs:
1313
name: "Build source package"
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
17-
- uses: actions/setup-python@v4
18-
with: {python-version: "3.11"}
19-
- run: python3 -m pip install -r etc/requirements.build.txt --disable-pip-version-check
16+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
17+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
18+
with:
19+
python-version: "3.14"
20+
pip-install: -r etc/requirements.build.txt
2021
- run: python3 setup.py sdist
21-
- uses: actions/upload-artifact@v3
22-
with: {name: "dist", path: "dist"}
22+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
23+
with: {name: "sdist", path: "dist"}
2324

2425
cibuildwheel:
2526
name: "Wheels: ${{matrix.sys.name}} [${{matrix.sys.archs}}]"
2627
runs-on: ${{matrix.sys.os}}
2728
strategy:
2829
matrix:
2930
sys:
30-
- {os: "ubuntu-latest", name: "Linux", archs: "auto", qemu: false}
31-
- {os: "ubuntu-latest", name: "Linux", archs: "aarch64", qemu: true}
32-
- {os: "macos-latest", name: "MacOS", archs: "x86_64 arm64 universal2", qemu: false}
33-
- {os: "windows-latest", name: "Windows", archs: "auto", qemu: false}
31+
- {os: "ubuntu-latest", name: "Linux", archs: "auto"}
32+
- {os: "ubuntu-24.04-arm", name: "Linux", archs: "aarch64"}
33+
- {os: "macos-15-intel", name: "MacOS", archs: "x86_64 universal2"}
34+
- {os: "macos-latest", name: "MacOS", archs: "auto"}
35+
- {os: "windows-latest", name: "Windows", archs: "auto"}
3436
steps:
35-
- uses: actions/checkout@v4
36-
- name: "Set up QEMU"
37-
if: ${{matrix.sys.qemu}}
38-
uses: docker/setup-qemu-action@v2
39-
with:
40-
platforms: all
41-
- uses: pypa/cibuildwheel@v2.16
37+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
38+
- uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
4239
env:
4340
CIBW_ARCHS: "${{matrix.sys.archs}}"
44-
# cp38: cp37-macos does not support universal2/arm64
45-
CIBW_BUILD: "cp38-* pp*-manylinux_x86_64"
46-
CIBW_SKIP: "pp37-*"
4741
- name: "Check"
4842
shell: bash
4943
run: |
5044
ls -l wheelhouse
51-
- uses: actions/upload-artifact@v3
52-
with: {name: "dist", path: "wheelhouse"}
45+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
46+
with: {name: "wheel-${{matrix.sys.os}}", path: "wheelhouse"}
5347

54-
publish:
55-
name: "Publish"
48+
dist:
49+
name: "Collect files"
5650
runs-on: ubuntu-latest
5751
needs: [sdist, cibuildwheel]
5852
steps:
59-
- uses: actions/checkout@v4
60-
- uses: actions/setup-python@v4
61-
with: {python-version: "3.11"}
53+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
54+
with: { path: "dist", merge-multiple: true }
55+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
56+
with: {name: "dist", path: "dist"}
6257

63-
- run: python3 -m pip install -r etc/requirements.build.txt --disable-pip-version-check
58+
publish-github:
59+
name: "Publish to Github"
60+
runs-on: ubuntu-latest
61+
needs: [dist]
62+
permissions:
63+
contents: write
64+
steps:
65+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
66+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
67+
with:
68+
python-version: "3.14"
69+
pip-install: -r etc/requirements.build.txt
6470

65-
- name: "Get files"
66-
uses: actions/download-artifact@v3
71+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
6772
with: {name: "dist", path: "dist"}
6873

6974
- name: "Install pandoc"
@@ -73,6 +78,7 @@ jobs:
7378
7479
- name: "Prepare"
7580
run: |
81+
ls -l dist
7682
PACKAGE=$(python3 setup.py --name)
7783
VERSION=$(python3 setup.py --version)
7884
TGZ="${PACKAGE}-${VERSION}.tar.gz"
@@ -87,7 +93,7 @@ jobs:
8793
esac
8894
8995
test "${{github.ref}}" = "refs/tags/v${VERSION}" || { echo "ERR: tag mismatch"; exit 1; }
90-
test -f "dist/${TGZ}" || { echo "ERR: sdist failed"; exit 1; }
96+
test -f "dist/${TGZ}" || { echo "ERR: sdist failed [dist/${TGZ}]"; ls -l dist; exit 1; }
9197
echo "PACKAGE=${PACKAGE}" >> $GITHUB_ENV
9298
echo "VERSION=${VERSION}" >> $GITHUB_ENV
9399
echo "TGZ=${TGZ}" >> $GITHUB_ENV
@@ -106,20 +112,33 @@ jobs:
106112
ghf="--notes-file=./tmp/note.md"
107113
if test "${DRAFT}" = "true"; then ghf="${ghf} --draft"; fi
108114
if test "${PRERELEASE}" = "true"; then ghf="${ghf} --prerelease"; fi
109-
gh release create "v${VERSION}" "dist/${TGZ}" --title="${title}" ${ghf}
115+
#gh release create "v${VERSION}" --title="${title}" ${ghf} dist/*
116+
gh release create "v${VERSION}" --title="${title}" ${ghf} dist/${TGZ}
110117
111-
- name: "Upload to PYPI"
112-
id: pypi_upload
113-
env:
114-
PYPI_TOKEN: ${{secrets.PYPI_TOKEN}}
115-
PYPI_TEST_TOKEN: ${{secrets.PYPI_TEST_TOKEN}}
116-
run: |
117-
ls -l dist
118-
if test "${DRAFT}" = "false"; then
119-
python -m twine upload -u __token__ -p ${PYPI_TOKEN} \
120-
--repository pypi --disable-progress-bar dist/*
121-
else
122-
python -m twine upload -u __token__ -p ${PYPI_TEST_TOKEN} \
123-
--repository testpypi --disable-progress-bar dist/*
124-
fi
118+
publish-pypi:
119+
if: ${{ !contains(github.ref_name, '.dev') }}
120+
name: "Publish to PyPi"
121+
runs-on: ubuntu-latest
122+
needs: [dist]
123+
permissions:
124+
id-token: write
125+
environment: pypi
126+
steps:
127+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
128+
with: { name: "dist", path: "dist" }
129+
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
130+
131+
publish-testpypi:
132+
if: ${{ contains(github.ref_name, '.dev') }}
133+
name: "Publish to TestPyPi"
134+
runs-on: ubuntu-latest
135+
needs: [dist]
136+
permissions:
137+
id-token: write
138+
environment: testpypi
139+
steps:
140+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
141+
with: { name: "dist", path: "dist" }
142+
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
143+
with: { repository-url: "https://test.pypi.org/legacy/" }
125144

0 commit comments

Comments
 (0)