Skip to content

Commit d8cda92

Browse files
committed
AP-605: build pypi pakages
* builds pypi packages with versioning managed by setuptools_scm
1 parent 14a272b commit d8cda92

2 files changed

Lines changed: 58 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and publish dev release to PyPI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
# types:
8+
# - closed
9+
10+
jobs:
11+
build:
12+
# if: github.event.pull_request.merged == true
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v7
19+
with:
20+
version: "0.10.7"
21+
python-version: "3.14"
22+
enable-cache: true
23+
24+
- name: Build Python package
25+
run: |
26+
uv run build
27+
28+
- name: Upload package distributions as artifact
29+
uses: actions/upload-artifact@v7
30+
with:
31+
name: python-package-distributions
32+
path: |
33+
dist/
34+
!dist/.gitignore
35+
36+
testpypi-publish:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: testpypi
41+
url: https://test.pypi.org/p/python-tind-client
42+
permissions:
43+
id-token: write
44+
steps:
45+
- uses: actions/checkout@v6
46+
47+
- name: Download built package distributions
48+
uses: actions/download-artifact@v8
49+
with:
50+
name: python-package-distributions
51+
path: dist/
52+
53+
- name: Public package distributions to PyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
with:
56+
repository-url: https://test.pypi.org/legacy/

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["setuptools>=80"]
2+
requires = ["setuptools>=80", "setuptools-scm[simple]>=8"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "python-tind-client"
7-
version = "0.2.1"
7+
dynamic = ["version"]
88
description = "Python library for interacting with the TIND DA API"
99
readme = "README.md"
1010
license = { file = "LICENSE" }

0 commit comments

Comments
 (0)