Skip to content

Commit 6e23895

Browse files
committed
feat(ci): create pipeline to publish package to PyPI on each release
1 parent 2f18e3f commit 6e23895

4 files changed

Lines changed: 60 additions & 6 deletions

File tree

.github/workflows/docs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docs
1+
name: Publish Docs
22

33
on:
44
push:
@@ -9,8 +9,13 @@ permissions:
99
contents: write
1010

1111
jobs:
12+
test:
13+
uses: ./.github/workflows/test.yml
14+
1215
deploy:
1316
runs-on: ubuntu-latest
17+
needs: test
18+
1419
steps:
1520
- uses: actions/checkout@v4
1621

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: PR
22

33
on:
44
pull_request:

.github/workflows/publish.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
test:
14+
uses: ./.github/workflows/test.yml
15+
16+
docs:
17+
uses: ./.github/workflows/docs.yml
18+
19+
build-and-publish:
20+
runs-on: ubuntu-latest
21+
needs:
22+
- test
23+
- docs
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.11"
35+
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v3
38+
39+
- name: Sync deps (including build tools)
40+
run: |
41+
uv sync --all-extras --dev
42+
43+
- name: Build (sdist + wheel)
44+
run: |
45+
make build
46+
47+
- name: Publish to PyPI
48+
uses: pypa/gh-action-pypi-publish@release/v1
49+
with:
50+
packages-dir: dist
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Run Tests
22

33
on:
44
release:
@@ -7,14 +7,13 @@ on:
77
branches:
88
- main
99
paths-ignore:
10-
- README.md
11-
- CHANGELOG.md
10+
- *.md
1211

1312
env:
1413
PROJECT_NAME: typeid-python
1514

1615
jobs:
17-
build:
16+
test:
1817
runs-on: ubuntu-latest
1918
strategy:
2019
fail-fast: false

0 commit comments

Comments
 (0)