Skip to content

Commit 31be776

Browse files
abrichrclaude
andcommitted
build: prepare package for PyPI publishing
- Add maintainers field (OpenAdaptAI) to pyproject.toml - Add extended project URLs (Documentation, Issues, Changelog) - Add MIT LICENSE file - Add GitHub Actions workflow for trusted PyPI publishing on version tags Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cfb7abf commit 31be776

3 files changed

Lines changed: 127 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.12'
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v4
22+
with:
23+
version: "latest"
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-retrieval
41+
permissions:
42+
id-token: write # Required for trusted publishing
43+
44+
steps:
45+
- name: Download distribution packages
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+
# No API token needed - uses trusted publishing via OIDC
54+
55+
publish-to-testpypi:
56+
name: Publish to TestPyPI
57+
needs: build
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: testpypi
61+
url: https://test.pypi.org/p/openadapt-retrieval
62+
permissions:
63+
id-token: write # Required for trusted publishing
64+
65+
steps:
66+
- name: Download distribution packages
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: python-package-distributions
70+
path: dist/
71+
72+
- name: Publish to TestPyPI
73+
uses: pypa/gh-action-pypi-publish@release/v1
74+
with:
75+
repository-url: https://test.pypi.org/legacy/
76+
# No API token needed - uses trusted publishing via OIDC
77+
78+
github-release:
79+
name: Create GitHub Release
80+
needs: publish-to-pypi
81+
runs-on: ubuntu-latest
82+
permissions:
83+
contents: write # Required to create releases
84+
85+
steps:
86+
- name: Download distribution packages
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: python-package-distributions
90+
path: dist/
91+
92+
- name: Create GitHub Release
93+
env:
94+
GITHUB_TOKEN: ${{ github.token }}
95+
run: |
96+
gh release create '${{ github.ref_name }}' \
97+
--repo '${{ github.repository }}' \
98+
--title '${{ github.ref_name }}' \
99+
--generate-notes \
100+
dist/*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 OpenAdaptAI
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

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", email = "info@openadapt.ai"}
17+
]
1518
keywords = ["retrieval", "embeddings", "multimodal", "vlm", "gui", "automation", "faiss"]
1619
classifiers = [
1720
"Development Status :: 3 - Alpha",
@@ -63,6 +66,9 @@ openadapt-retrieval = "openadapt_retrieval.cli:main"
6366
[project.urls]
6467
Homepage = "https://github.com/OpenAdaptAI/openadapt-retrieval"
6568
Repository = "https://github.com/OpenAdaptAI/openadapt-retrieval"
69+
Documentation = "https://github.com/OpenAdaptAI/openadapt-retrieval#readme"
70+
Issues = "https://github.com/OpenAdaptAI/openadapt-retrieval/issues"
71+
Changelog = "https://github.com/OpenAdaptAI/openadapt-retrieval/releases"
6672

6773
[tool.hatch.build.targets.wheel]
6874
packages = ["src/openadapt_retrieval"]

0 commit comments

Comments
 (0)