Skip to content

Commit 6a396e6

Browse files
committed
Update CI workflows
1 parent 070cb12 commit 6a396e6

File tree

2 files changed

+58
-42
lines changed

2 files changed

+58
-42
lines changed

.github/workflows/python-package.yml

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
ruff:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- name: Install Ruff
2424
run: pip install ruff
2525
- name: Ruff Check
@@ -30,13 +30,13 @@ jobs:
3030
mypy:
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3434
- name: Checkout submodules
3535
run: git submodule update --init --recursive --depth 1
3636
- name: Install typing dependencies
3737
run: pip install mypy pytest -r requirements.txt
3838
- name: Mypy
39-
uses: liskin/gh-problem-matcher-wrap@v2
39+
uses: liskin/gh-problem-matcher-wrap@v3
4040
with:
4141
linters: mypy
4242
run: mypy --show-column-numbers
@@ -48,7 +48,7 @@ jobs:
4848
run: sudo apt-get update
4949
- name: Install APT dependencies
5050
run: sudo apt-get install libsdl2-dev
51-
- uses: actions/checkout@v3
51+
- uses: actions/checkout@v4
5252
with:
5353
fetch-depth: ${{ env.git-depth }}
5454
- name: Checkout submodules
@@ -57,11 +57,12 @@ jobs:
5757
run: pip install build
5858
- name: Build source distribution
5959
run: python -m build --sdist
60-
- uses: actions/upload-artifact@v3
60+
- uses: actions/upload-artifact@v4
6161
with:
6262
name: sdist
6363
path: dist/tcod-*.tar.gz
6464
retention-days: 7
65+
compression-level: 0
6566

6667
# This makes sure that the latest versions of the SDL headers parse correctly.
6768
parse_sdl:
@@ -73,12 +74,12 @@ jobs:
7374
sdl-version: ["2.0.14", "2.0.16"]
7475
fail-fast: true
7576
steps:
76-
- uses: actions/checkout@v3
77+
- uses: actions/checkout@v4
7778
with:
7879
fetch-depth: ${{ env.git-depth }}
7980
- name: Checkout submodules
8081
run: git submodule update --init --recursive --depth 1
81-
- uses: actions/setup-python@v4
82+
- uses: actions/setup-python@v5
8283
with:
8384
python-version: "3.x"
8485
- name: Install build dependencies
@@ -94,7 +95,7 @@ jobs:
9495
strategy:
9596
matrix:
9697
os: ["ubuntu-latest", "windows-latest"]
97-
python-version: ["3.8", "3.9", "pypy-3.8"]
98+
python-version: ["3.8", "pypy-3.8"]
9899
architecture: ["x64"]
99100
include:
100101
- os: "windows-latest"
@@ -106,14 +107,14 @@ jobs:
106107
fail-fast: false
107108

108109
steps:
109-
- uses: actions/checkout@v3
110+
- uses: actions/checkout@v4
110111
with:
111112
fetch-depth: ${{ env.git-depth }}
112113
- name: Checkout submodules
113114
run: |
114115
git submodule update --init --recursive --depth 1
115116
- name: Set up Python ${{ matrix.python-version }}
116-
uses: actions/setup-python@v4
117+
uses: actions/setup-python@v5
117118
with:
118119
python-version: ${{ matrix.python-version }}
119120
architecture: ${{ matrix.architecture }}
@@ -144,13 +145,16 @@ jobs:
144145
- name: Xvfb logs
145146
if: runner.os != 'Windows'
146147
run: cat /tmp/xvfb.log
147-
- uses: codecov/codecov-action@v3
148-
- uses: actions/upload-artifact@v3
148+
- uses: codecov/codecov-action@v4
149+
with:
150+
token: ${{ secrets.CODECOV_TOKEN }}
151+
- uses: actions/upload-artifact@v4
149152
if: runner.os == 'Windows'
150153
with:
151-
name: wheels-windows
154+
name: wheels-windows-${{ matrix.architecture }}-${{ matrix.python-version }}
152155
path: dist/*.whl
153156
retention-days: 7
157+
compression-level: 0
154158

155159
test-docs:
156160
needs: [ruff, mypy]
@@ -160,7 +164,7 @@ jobs:
160164
run: |
161165
sudo apt-get update
162166
sudo apt-get install libsdl2-dev
163-
- uses: actions/checkout@v3
167+
- uses: actions/checkout@v4
164168
with:
165169
fetch-depth: ${{ env.git-depth }}
166170
- name: Checkout submodules
@@ -184,13 +188,13 @@ jobs:
184188
matrix:
185189
os: ["ubuntu-latest", "windows-latest"]
186190
steps:
187-
- uses: actions/checkout@v3
191+
- uses: actions/checkout@v4
188192
with:
189193
fetch-depth: ${{ env.git-depth }}
190194
- name: Checkout submodules
191195
run: git submodule update --init --depth 1
192196
- name: Set up Python
193-
uses: actions/setup-python@v4
197+
uses: actions/setup-python@v5
194198
with:
195199
python-version: "3.x"
196200
- name: Install Python dependencies
@@ -212,18 +216,20 @@ jobs:
212216
matrix:
213217
arch: ["x86_64", "aarch64"]
214218
build: ["cp38-manylinux*", "pp38-manylinux*"]
219+
env:
220+
BUILD_DESC:
215221
steps:
216-
- uses: actions/checkout@v3
222+
- uses: actions/checkout@v4
217223
with:
218224
fetch-depth: ${{ env.git-depth }}
219225
- name: Set up QEMU
220226
if: ${{ matrix.arch == 'aarch64' }}
221-
uses: docker/setup-qemu-action@v2
227+
uses: docker/setup-qemu-action@v3
222228
- name: Checkout submodules
223229
run: |
224230
git submodule update --init --recursive --depth 1
225231
- name: Set up Python
226-
uses: actions/setup-python@v4
232+
uses: actions/setup-python@v5
227233
with:
228234
python-version: "3.x"
229235
- name: Install Python dependencies
@@ -247,33 +253,44 @@ jobs:
247253
CIBW_TEST_COMMAND: python -c "import tcod.context"
248254
# Skip test on emulated architectures
249255
CIBW_TEST_SKIP: "*_aarch64"
256+
- name: Remove asterisk from label
257+
run: |
258+
BUILD_DESC=${{ matrix.build }}
259+
BUILD_DESC=${BUILD_DESC//\*}
260+
echo BUILD_DESC=${BUILD_DESC} >> $GITHUB_ENV
250261
- name: Archive wheel
251-
uses: actions/upload-artifact@v3
262+
uses: actions/upload-artifact@v4
252263
with:
253-
name: wheels-linux
264+
name: wheels-linux-${{ matrix.arch }}-${{ env.BUILD_DESC }}
254265
path: wheelhouse/*.whl
255266
retention-days: 7
267+
compression-level: 0
256268

257269
build-macos:
258270
needs: [ruff, mypy]
259-
runs-on: "macos-11"
271+
runs-on: "macos-14"
260272
strategy:
261273
fail-fast: true
262274
matrix:
263-
python: ["cp38-*_universal2", "cp38-*_x86_64", "cp38-*_arm64", "pp38-*"]
275+
python: ["cp38-*_universal2", "cp38-*_x86_64", "pp38-*"]
276+
env:
277+
PYTHON_DESC:
264278
steps:
265-
- uses: actions/checkout@v3
279+
- uses: actions/checkout@v4
266280
with:
267281
fetch-depth: ${{ env.git-depth }}
268282
- name: Checkout submodules
269283
run: git submodule update --init --recursive --depth 1
284+
- uses: actions/setup-python@v5
285+
with:
286+
python-version: "3.x"
270287
- name: Install Python dependencies
271-
run: pip3 install -r requirements.txt
288+
run: pip install -r requirements.txt
272289
- name: Prepare package
273290
# Downloads SDL2 for the later step.
274-
run: python3 build_sdl.py
291+
run: python build_sdl.py
275292
- name: Build wheels
276-
uses: pypa/cibuildwheel@v2.17.0
293+
uses: pypa/cibuildwheel@v2.19.1
277294
env:
278295
CIBW_BUILD: ${{ matrix.python }}
279296
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
@@ -282,39 +299,38 @@ jobs:
282299
CIBW_TEST_COMMAND: python -c "import tcod.context"
283300
CIBW_TEST_SKIP: "pp* *-macosx_arm64 *-macosx_universal2:arm64"
284301
MACOSX_DEPLOYMENT_TARGET: "10.11"
302+
- name: Remove asterisk from label
303+
run: |
304+
PYTHON_DESC=${{ matrix.python }}
305+
PYTHON_DESC=${PYTHON_DESC//\*/X}
306+
echo PYTHON_DESC=${PYTHON_DESC} >> $GITHUB_ENV
285307
- name: Archive wheel
286-
uses: actions/upload-artifact@v3
308+
uses: actions/upload-artifact@v4
287309
with:
288-
name: wheels-macos
310+
name: wheels-macos-${{ env.PYTHON_DESC }}
289311
path: wheelhouse/*.whl
290312
retention-days: 7
313+
compression-level: 0
291314

292315
publish:
293316
needs: [sdist, build, build-macos, linux-wheels]
294317
runs-on: ubuntu-latest
295318
if: startsWith(github.ref, 'refs/tags/')
296319
environment:
297320
name: release
298-
url: https://pypi.org/p/tcod
321+
url: https://pypi.org/project/tcod/
299322
permissions:
300323
id-token: write
301324
steps:
302-
- uses: actions/download-artifact@v3
325+
- uses: actions/download-artifact@v4
303326
with:
304327
name: sdist
305328
path: dist/
306-
- uses: actions/download-artifact@v3
307-
with:
308-
name: wheels-windows
309-
path: dist/
310-
- uses: actions/download-artifact@v3
311-
with:
312-
name: wheels-macos
313-
path: dist/
314-
- uses: actions/download-artifact@v3
329+
- uses: actions/download-artifact@v4
315330
with:
316-
name: wheels-linux
331+
pattern: wheels-*
317332
path: dist/
333+
merge-multiple: true
318334
- uses: pypa/gh-action-pypi-publish@release/v1
319335
with:
320336
skip-existing: true

.github/workflows/release-on-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
contents: write
1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
- name: Generate body
1818
run: |
1919
scripts/get_release_description.py | tee release_body.md

0 commit comments

Comments
 (0)