From a9aad32d2cc0a6be0248735375bd524129905f7c Mon Sep 17 00:00:00 2001 From: Georges Toth Date: Mon, 4 Nov 2024 00:00:14 +0100 Subject: [PATCH] fix codecov; update publishing workflow --- .github/workflows/pypi_publish.yml | 53 +++++++++++++++++++++--------- .github/workflows/test_lint.yml | 14 ++++---- 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index 6d5affe..7489faa 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -6,21 +6,42 @@ on: - 'v*' jobs: - deploy: + release-build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip build twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.python_openhab_github_deploy }} - run: | - python -m build - twine upload dist/* + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies and build wheel + run: | + python -m pip install uv + uv build --wheel + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + needs: + - release-build + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + # Specifying a GitHub environment is optional, but strongly encouraged + environment: + name: release + url: https://pypi.org/project/python-openhab/ + + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test_lint.yml b/.github/workflows/test_lint.yml index 6a2c9eb..8ed98fc 100644 --- a/.github/workflows/test_lint.yml +++ b/.github/workflows/test_lint.yml @@ -58,23 +58,23 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{env.PYTHON_LATEST}} - - - run: python -m pip install --upgrade coverage[toml] - - uses: actions/download-artifact@v4 with: pattern: coverage-data-* merge-multiple: true - - name: Combine coverage & create xml report - run: | - python -m coverage combine - python -m coverage xml + - run: | + python3 -m pip install uv + uv pip install coverage[toml] + uv run coverage combine + uv run coverage xml - name: Upload Coverage to Codecov uses: codecov/codecov-action@v4 with: fail_ci_if_error: true files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true lint_python: