Skip to content

initial commit

initial commit #1

Workflow file for this run

name: Release
# Publishes to PyPI when you push a version tag (e.g. v0.1.0).
# Pushing to main only runs ci.yml — tag a release to publish.
on:
push:
tags:
- "v*"
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
quality:
name: Lint and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run ruff
run: ruff check src tests
- name: Run ruff format check
run: ruff format --check src tests
- name: Run mypy
run: mypy src
- name: Run pytest
run: pytest --cov=technitiumdns --cov-report=term
build:
name: Build distributions
runs-on: ubuntu-latest
needs: quality
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
- name: Install build tools
run: |
python -m pip install --upgrade pip build twine
- name: Build distributions
run: python -m build
- name: Validate distributions
run: twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: dist
path: dist/
publish-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/project/technitiumdns-api/
permissions:
id-token: write
steps:
- name: Download built distributions
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Publish to PyPI via trusted publishing
uses: pypa/gh-action-pypi-publish@release/v1