Skip to content

Commit bd4cbb0

Browse files
abrichrclaude
andcommitted
build(viewer): prepare package for PyPI publishing
Add maintainer field, expand project URLs (documentation, issues, changelog), and create GitHub Actions workflow for automated PyPI publishing using trusted publishing on version tags. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 651ea1e commit bd4cbb0

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Build distribution
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v4
17+
with:
18+
version: "latest"
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
25+
- name: Build package
26+
run: uv build
27+
28+
- name: Store distribution packages
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: python-package-distributions
32+
path: dist/
33+
34+
publish-to-pypi:
35+
name: Publish to PyPI
36+
needs: build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/p/openadapt-viewer
41+
permissions:
42+
id-token: write # Required for trusted publishing
43+
44+
steps:
45+
- name: Download distributions
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: python-package-distributions
49+
path: dist/
50+
51+
- name: Publish to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1
53+
54+
github-release:
55+
name: Create GitHub Release
56+
needs: publish-to-pypi
57+
runs-on: ubuntu-latest
58+
permissions:
59+
contents: write
60+
61+
steps:
62+
- name: Download distributions
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: python-package-distributions
66+
path: dist/
67+
68+
- name: Create GitHub Release
69+
env:
70+
GITHUB_TOKEN: ${{ github.token }}
71+
run: |
72+
gh release create '${{ github.ref_name }}' \
73+
--repo '${{ github.repository }}' \
74+
--title '${{ github.ref_name }}' \
75+
--generate-notes \
76+
dist/*

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ license = "MIT"
1212
authors = [
1313
{name = "Richard Abrich", email = "richard@openadapt.ai"}
1414
]
15+
maintainers = [
16+
{name = "OpenAdaptAI"}
17+
]
1518
keywords = ["viewer", "dashboard", "visualization", "ml", "benchmarks", "html"]
1619
classifiers = [
1720
"Development Status :: 3 - Alpha",
@@ -47,6 +50,9 @@ openadapt-viewer = "openadapt_viewer.cli:main"
4750
[project.urls]
4851
Homepage = "https://github.com/OpenAdaptAI/openadapt-viewer"
4952
Repository = "https://github.com/OpenAdaptAI/openadapt-viewer"
53+
Documentation = "https://github.com/OpenAdaptAI/openadapt-viewer#readme"
54+
Issues = "https://github.com/OpenAdaptAI/openadapt-viewer/issues"
55+
Changelog = "https://github.com/OpenAdaptAI/openadapt-viewer/releases"
5056

5157
[tool.hatch.build.targets.wheel]
5258
packages = ["src/openadapt_viewer"]

0 commit comments

Comments
 (0)