|
1 | 1 | name: release |
2 | 2 |
|
3 | | -on: |
| 3 | +on: |
4 | 4 | push: |
5 | 5 | tags: |
6 | | - - '*' |
| 6 | + - "*" |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - release-test: |
10 | | - runs-on: ubuntu-22.04 |
11 | | - steps: |
12 | | - - uses: actions/checkout@v4 |
13 | | - |
14 | | - - uses: ./.github/actions/build-package |
15 | | - |
16 | | - - name: Set up a fresh environment and run tests |
17 | | - run: | |
18 | | - python -m venv venv |
19 | | - source venv/bin/activate |
20 | | - pip install dist/*.tar.gz |
21 | | - pip install dist/*.whl |
22 | | - pip install -e .[test] |
23 | | - pytest |
24 | | -
|
25 | | - release: |
26 | | - runs-on: ubuntu-22.04 |
27 | | - needs: release-test |
28 | | - |
29 | | - steps: |
30 | | - - uses: actions/checkout@v4 |
31 | | - |
32 | | - - name: Set up Python 3.8 |
33 | | - uses: actions/setup-python@v5 |
34 | | - with: |
35 | | - python-version: 3.8 |
36 | | - |
37 | | - - name: Compare tags |
38 | | - run: | |
39 | | - PKG_VERSION=`grep '__version__' mapbox_tilesets/__init__.py | sed -E "s/^.*['\"](.*)['\"].*$/\1/"` |
40 | | - echo "Checking that package version [v$PKG_VERSION] matches release tag [${{ github.ref_name }}]" |
41 | | - [ "${{ github.ref_type }}" = "tag" ] && [ "${{ github.ref_name }}" = "v$PKG_VERSION" ] |
42 | | -
|
43 | | - - uses: ./.github/actions/build-package |
44 | | - |
45 | | - - name: Run deployment |
46 | | - run: |
47 | | - twine upload dist/* -r pypi -u __token__ -p ${{ secrets.PYPI_PASSWORD }} |
| 9 | + release-test: |
| 10 | + runs-on: ubuntu-22.04 |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v4 |
| 13 | + |
| 14 | + - name: Set up uv |
| 15 | + uses: astral-sh/setup-uv@v4 |
| 16 | + with: |
| 17 | + python-version: "3.10" |
| 18 | + |
| 19 | + - name: Build package |
| 20 | + run: uv build |
| 21 | + |
| 22 | + - name: Set up a fresh environment and run tests |
| 23 | + run: | |
| 24 | + uv venv |
| 25 | + uv pip install dist/*.tar.gz |
| 26 | + uv pip install dist/*.whl |
| 27 | + uv pip install pytest |
| 28 | + uv run pytest |
| 29 | +
|
| 30 | + release: |
| 31 | + runs-on: ubuntu-22.04 |
| 32 | + needs: release-test |
| 33 | + |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Set up uv |
| 38 | + uses: astral-sh/setup-uv@v4 |
| 39 | + with: |
| 40 | + python-version: "3.10" |
| 41 | + |
| 42 | + - name: Compare tags |
| 43 | + run: | |
| 44 | + PKG_VERSION=`grep '__version__' mapbox_tilesets/__init__.py | sed -E "s/^.*['\"](.*)['\"].*$/\1/"` |
| 45 | + echo "Checking that package version [v$PKG_VERSION] matches release tag [${{ github.ref_name }}]" |
| 46 | + [ "${{ github.ref_type }}" = "tag" ] && [ "${{ github.ref_name }}" = "v$PKG_VERSION" ] |
| 47 | +
|
| 48 | + - name: Build package |
| 49 | + run: uv build |
| 50 | + |
| 51 | + - name: Install Twine |
| 52 | + run: | |
| 53 | + uv venv |
| 54 | + uv pip install twine |
| 55 | +
|
| 56 | + - name: Validate deployment |
| 57 | + run: uv run twine check dist/* |
| 58 | + |
| 59 | + - name: Run deployment |
| 60 | + run: uv run twine upload dist/* -r pypi -u __token__ -p ${{ secrets.PYPI_PASSWORD }} |
0 commit comments