Switch to uv #83
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Dev release | |
| on: | |
| push: | |
| branches-ignore: | |
| - dependabot/** | |
| - pre-commit-ci-update-config | |
| workflow_dispatch: | |
| env: | |
| DEFAULT_PYTHON: '3.13' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| release: | |
| name: Release package | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'dolfinus/setuptools-git-versioning' # prevent running on forks | |
| environment: | |
| name: test-pypi | |
| url: https://test.pypi.org/p/onetl | |
| permissions: | |
| id-token: write # to auth in Test PyPI | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
| id: python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: "false" | |
| - name: Fix version number | |
| # Fix for https://github.com/dolfinus/setuptools-git-versioning/issues/72#issuecomment-1312589464 | |
| run: | | |
| version=$(uv run -m setuptools_git_versioning) | |
| sed -i -E "s/dynamic = .*/version = "${version}"/" pyproject.toml | |
| - name: Build package | |
| run: uv build | |
| - name: Publish package | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |