|
10 | 10 | jobs: |
11 | 11 | build: |
12 | 12 | name: Build package |
13 | | - runs-on: ubuntu-latest |
| 13 | + runs-on: ubuntu-22.04 # Provides system Python 3.10 |
14 | 14 |
|
15 | 15 | steps: |
16 | 16 | - uses: actions/checkout@v4 |
17 | 17 |
|
18 | 18 | # We use Python 3.10 here because it's the minimum Python version supported by this library. |
19 | | - - name: Setup Python 3.10 |
20 | | - uses: actions/setup-python@v5 |
| 19 | + - name: setup Python v3.10 with uv |
| 20 | + uses: astral-sh/setup-uv@v6 |
21 | 21 | with: |
22 | 22 | python-version: '3.10' |
23 | 23 |
|
24 | | - - name: Install dependencies |
25 | | - run: pip install --upgrade pip build |
26 | | - |
27 | 24 | - name: Build package |
28 | | - run: python -m build |
| 25 | + run: uv build |
29 | 26 |
|
30 | 27 | - name: Upload build artifacts |
31 | 28 | uses: actions/upload-artifact@v4 |
32 | 29 | with: |
33 | 30 | name: dist_packages |
34 | 31 | path: dist/ |
35 | 32 |
|
36 | | - test: |
37 | | - # This job tests the built package by installing it via pip and running unit tests (without tox). |
38 | | - name: Test package |
39 | | - needs: build |
40 | | - runs-on: ubuntu-latest |
41 | | - |
42 | | - steps: |
43 | | - - uses: actions/checkout@v4 |
44 | | - |
45 | | - - name: setup Python v3.10 with uv |
46 | | - uses: astral-sh/setup-uv@v6 |
47 | | - with: |
48 | | - python-version: '3.10' |
49 | | - |
50 | | - - name: install packages |
51 | | - run: uv pip install -r pyproject.toml --extra testing |
52 | | - |
53 | | - - name: Download build artifacts |
54 | | - uses: actions/download-artifact@v4 |
55 | | - with: |
56 | | - name: dist_packages |
57 | | - path: dist/ |
58 | | - |
59 | | - - name: Install built package |
60 | | - run: pip install dist/xml2python-*.whl |
61 | | - |
62 | | - - name: Run unit tests |
63 | | - run: python -m pytest |
64 | | - |
65 | 33 | publish: |
66 | 34 | name: Publish package |
67 | | - needs: test |
68 | | - runs-on: ubuntu-latest |
| 35 | + needs: build |
| 36 | + runs-on: ubuntu-22.04 |
69 | 37 |
|
70 | 38 | steps: |
71 | 39 | - name: Download build artifacts |
|
78 | 46 | uses: AButler/upload-release-assets@v3.0 |
79 | 47 | with: |
80 | 48 | files: dist/* |
81 | | - repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + repo-token: ${{ secrets.PYPI_API_TOKEN }} |
82 | 50 |
|
83 | 51 | - name: Publish package to PyPI |
84 | 52 | uses: pypa/gh-action-pypi-publish@v1.12.4 |
|
0 commit comments