Skip to content

Update version (#24) #23

Update version (#24)

Update version (#24) #23

Workflow file for this run

name: CD
on:
push:
branches:
- main
workflow_dispatch:
jobs:
publish-to-pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
version: "0.4.10"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Run tests
run: |
uv run pytest --cov=nortech --cov-report=xml .
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Install the project
run: uv sync --all-extras
- name: Build the project
run: uv build
- name: Check for pyproject.toml changes
id: check-changes
run: |
if git diff --name-only HEAD^ HEAD | grep -q "pyproject.toml"; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
- name: Publish to PyPI
if: steps.check-changes.outputs.changed == 'true'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
uvx twine upload dist/*