Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build package

on:
push:

jobs:
python:
runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
python-version: '3.12'
- name: Install dependencies
run: uv sync --extra dev
- name: Run tests
run: uv run pytest
- name: Build package
run: uv build
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish package

on:
push:
tags:
- '*'

jobs:
pypi:
runs-on: ubuntu-latest

environment: packages

permissions:
# Required for PyPI trusted publishing (OIDC); no API token needed.
id-token: write

defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v6
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
python-version: '3.12'
- name: Install dependencies
run: uv sync --extra dev
- name: Set version
# The git tag (minus any leading "v") becomes the package version.
run: uv version "${GITHUB_REF_NAME#v}"
- name: Run tests
run: uv run pytest
- name: Build package
run: uv build
- name: Publish package
run: uv publish --trusted-publishing always
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/cadtopo"]

[tool.hatch.build.targets.sdist]
only-include = [
"src",
"README.md",
"LICENSE",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra"
Expand Down
Loading