Skip to content

Commit

Permalink
fix codecov; update publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0nx committed Nov 3, 2024
1 parent 4d85a14 commit a9aad32
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 23 deletions.
53 changes: 37 additions & 16 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions .github/workflows/test_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a9aad32

Please sign in to comment.