From ceed69909ad8030f4f479d9959027fc1bffbe458 Mon Sep 17 00:00:00 2001 From: disrupted Date: Fri, 20 Dec 2024 11:40:01 +0100 Subject: [PATCH] ci: update publish workflow --- .github/workflows/python-publish.yml | 49 ++++------------------------ 1 file changed, 7 insertions(+), 42 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index a5772b2..988804f 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -12,54 +12,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v4 with: python-version: "3.12" - - - name: Get Python version - id: python-version - run: echo version="$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> "$GITHUB_OUTPUT" - - - name: Run Poetry image - uses: abatilo/actions-poetry@v3.0.1 - with: - poetry-version: "1.1.12" - - - name: Set Poetry virtualenv - run: poetry config virtualenvs.in-project true - - - name: Set up cache - uses: actions/cache@v4 - id: cache - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.python-version.outputs.version }}-${{ hashFiles('poetry.lock') }} - - - name: Ensure cache is healthy - if: steps.cache.outputs.cache-hit == 'true' - shell: bash - run: timeout 10s python -m poetry run pip --version || rm -rf .venv - - - name: Install dependencies - run: poetry install --no-interaction - - # - name: Bump version - # env: - # VERSION: ${{ github.event.release.tag_name }} - # run: poetry version $(echo $VERSION | sed -e 's/^v//') + version: latest - name: Build - run: poetry build + run: uv build - name: Publish TestPyPI + run: uv publish --trusted-publishing always -r testpypi env: - POETRY_REPOSITORIES_TESTPYPI_URL: https://test.pypi.org/legacy/ - POETRY_HTTP_BASIC_TESTPYPI_USERNAME: __token__ - POETRY_HTTP_BASIC_TESTPYPI_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} - run: poetry publish -r testpypi + UV_PUBLISH_URL: https://test.pypi.org/legacy/ - name: Publish PyPI - env: - POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} - run: poetry publish + run: uv publish --trusted-publishing always