Skip to content

Commit 62cfa92

Browse files
committed
chore: update workflows
1 parent 11e73ab commit 62cfa92

File tree

2 files changed

+24
-37
lines changed

2 files changed

+24
-37
lines changed

.github/workflows/pypi-upload.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,22 @@ jobs:
1313
working-directory: unix
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717

1818
- uses: actions/setup-python@v6
1919
with:
2020
python-version: "3.10"
2121
architecture: x64
2222

23-
- name: Autobump version
24-
run: |
25-
# from refs/tags/v1.2.3 get 1.2.3
26-
VERSION=${GITHUB_REF/refs\/tags\//}
27-
PLACEHOLDER='__version__ = "v0.1.0"'
28-
VERSION_FILE='src/machine_stats/_version.py'
29-
30-
# grep ensures the placeholder is there. If grep doesn't find the placeholder
31-
# it exits with exit code 1 and github actions aborts the build.
32-
grep "$PLACEHOLDER" "$VERSION_FILE"
33-
34-
sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE"
35-
36-
- name: Install pypa/build and twine
37-
run: |
38-
python -m pip install build twine
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v6
25+
with:
26+
enable-cache: true
3927

40-
- name: Build a binary wheel and a source tarball
41-
run: |
42-
python -m build --sdist --wheel --outdir dist/ .
28+
- name: Install the project
29+
run: uv build
4330

44-
- name: Upload to PyPI via Twine
31+
- name: Publish
4532
env:
46-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
47-
run: |
48-
twine upload --verbose -u '__token__' dist/*
33+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
34+
run: uv publish

.github/workflows/python-tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.10", "3.11"]
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1515

1616
steps:
17-
- uses: actions/checkout@v3
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
17+
steps:
18+
- uses: actions/checkout@v5
19+
20+
- name: Install uv and set the Python version
21+
uses: astral-sh/setup-uv@v6
2022
with:
2123
python-version: ${{ matrix.python-version }}
22-
- name: Install dependencies
23-
run: |
24-
cd ./unix
25-
python -m pip install --upgrade pip
26-
pip install -r requirements.txt
27-
pip install -r dev-requirements.txt
28-
- name: Test with pytest
29-
run: |
30-
pytest
24+
enable-cache: true
25+
26+
- name: Install the project
27+
run: uv sync --locked --all-extras --dev
28+
29+
- name: Run tests
30+
# For example, using `pytest`
31+
run: uv run pytest tests

0 commit comments

Comments
 (0)