Skip to content

Commit 7111d82

Browse files
committed
Update and cleanup workflow
1 parent 00fb7f4 commit 7111d82

1 file changed

Lines changed: 36 additions & 16 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ name: Package
55

66
on:
77
push:
8+
branches:
9+
- "*"
10+
tags:
11+
- "*.*.*"
812
pull_request:
913
types: [opened, reopened]
1014

@@ -16,78 +20,94 @@ jobs:
1620
ruff:
1721
runs-on: ubuntu-latest
1822
steps:
19-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2024
- name: Install Ruff
2125
run: pip install ruff
2226
- name: Ruff Check
2327
run: ruff check . --output-format=github
2428
- name: Ruff Format
2529
run: ruff format . --check
2630

27-
28-
test:
31+
mypy:
2932
runs-on: ubuntu-latest
3033
strategy:
3134
matrix:
32-
python-version: ["3.8", "3.9", "3.10", "3.11"]
35+
python-version: ["3.8", "3.12"]
3336
steps:
34-
- uses: actions/checkout@v3
35-
- uses: actions/setup-python@v4
37+
- uses: actions/checkout@v4
38+
- uses: actions/setup-python@v5
3639
name: Setup Python ${{ matrix.python-version }}
3740
with:
3841
python-version: ${{ matrix.python-version }}
3942
- name: Install package
4043
run: pip install -e ".[test]"
4144
- name: Mypy
42-
uses: liskin/gh-problem-matcher-wrap@v2
45+
uses: liskin/gh-problem-matcher-wrap@v3
4346
with:
4447
linters: mypy
4548
run: mypy --show-column-numbers --python-version ${{ matrix.python-version }}
49+
50+
test:
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev"]
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: actions/setup-python@v5
58+
name: Setup Python ${{ matrix.python-version }}
59+
with:
60+
python-version: ${{ matrix.python-version }}
61+
- name: Install package
62+
run: pip install -e ".[test]"
4663
- name: Run tests
4764
run: pytest --cov-report=xml
4865
- name: Upload coverage
49-
uses: codecov/codecov-action@v3
66+
uses: codecov/codecov-action@v4
67+
with:
68+
token: ${{ secrets.CODECOV_TOKEN }}
5069

5170
build-dist:
5271
runs-on: ubuntu-latest
5372
steps:
54-
- uses: actions/checkout@v3
73+
- uses: actions/checkout@v4
5574
- name: Install build
5675
run: pip install build
5776
- name: Build package
5877
run: python -m build
59-
- uses: actions/upload-artifact@v3
78+
- uses: actions/upload-artifact@v4
6079
with:
6180
name: python-dist
6281
path: dist/*
6382
if-no-files-found: error
6483
retention-days: 1
84+
compression-level: 0
6585

6686
deploy:
6787
needs: [build-dist]
68-
if: startsWith(github.ref, 'refs/tags/')
88+
if: github.ref_type == 'tag'
6989
runs-on: ubuntu-latest
7090
environment:
71-
name: release
72-
url: https://pypi.org/p/tcod-ecs
91+
name: pypi
92+
url: https://pypi.org/project/tcod-ecs/${{ github.ref_name }}/
7393
permissions:
7494
id-token: write
7595
steps:
76-
- uses: actions/download-artifact@v3
96+
- uses: actions/download-artifact@v4
7797
with:
7898
name: python-dist
7999
path: dist/
80100
- uses: pypa/gh-action-pypi-publish@release/v1
81101

82102
release:
83-
if: startsWith(github.ref, 'refs/tags/')
103+
if: github.ref_type == 'tag'
84104
name: Create Release
85105
runs-on: ubuntu-latest
86106
permissions:
87107
contents: write
88108
steps:
89109
- name: Checkout code
90-
uses: actions/checkout@v3
110+
uses: actions/checkout@v4
91111
- name: Generate body
92112
run: scripts/get_release_description.py | tee release_body.md
93113
- name: Create Release

0 commit comments

Comments
 (0)