Skip to content

Commit 1a0c83e

Browse files
amosamos
authored andcommitted
ci: add automated PyPI + GitHub Release workflow
1 parent 478d982 commit 1a0c83e

2 files changed

Lines changed: 71 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
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+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
19+
- name: Install build tooling
20+
run: pip install --upgrade build
21+
22+
- name: Build sdist and wheel
23+
run: python -m build
24+
25+
- name: Check distribution metadata
26+
run: |
27+
pip install --upgrade twine
28+
twine check dist/*
29+
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: dist
33+
path: dist/
34+
35+
publish-pypi:
36+
name: Publish to PyPI
37+
needs: build
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/project/zerotoken/
42+
permissions:
43+
id-token: write
44+
steps:
45+
- uses: actions/download-artifact@v4
46+
with:
47+
name: dist
48+
path: dist/
49+
50+
- uses: pypa/gh-action-pypi-publish@release/v1
51+
52+
github-release:
53+
name: Create GitHub Release
54+
needs: publish-pypi
55+
runs-on: ubuntu-latest
56+
permissions:
57+
contents: write
58+
steps:
59+
- uses: actions/download-artifact@v4
60+
with:
61+
name: dist
62+
path: dist/
63+
64+
- uses: softprops/action-gh-release@v2
65+
with:
66+
files: dist/*
67+
generate_release_notes: true
68+
draft: false
69+
prerelease: false

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ dependencies = [
1515
"pydantic>=2.5.0",
1616
"apscheduler>=3.10.4",
1717
"mcp[cli]>=1.0.0",
18-
"build>=1.4.0",
1918
"pillow>=12.2.0",
2019
]
2120

@@ -29,6 +28,8 @@ test = [
2928
[dependency-groups]
3029
dev = [
3130
"ruff>=0.15.10",
31+
"build>=1.4.0",
32+
"twine>=5.0.0",
3233
]
3334
test = [
3435
"pytest>=7.0",

0 commit comments

Comments
 (0)