Skip to content

Commit e0bce25

Browse files
committed
Try to fix ci
1 parent 63fd2a5 commit e0bce25

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: CI
33
on:
44
push:
55
branches: [ master, develop ]
6+
tags:
7+
- '[0-9]+.[0-9]+.[0-9]+' # Triggers on version tags like 0.1.0, 1.2.3, etc.
68
pull_request:
79
branches: [ master, develop ]
810

.github/workflows/publish.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
11
name: Publish to PyPI
22

33
on:
4-
push:
5-
tags:
6-
- '[0-9]+.[0-9]+.[0-9]+' # Triggers on version tags like 0.1.0, 1.2.3, etc.
4+
workflow_run:
5+
workflows: ["CI"]
6+
types:
7+
- completed
8+
branches: [master, develop]
79

810
jobs:
911
publish:
1012
runs-on: ubuntu-latest
13+
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.ref, 'refs/tags/') }}
1114

1215
steps:
1316
- uses: actions/checkout@v4
1417

15-
- name: Set up Python
16-
uses: actions/setup-python@v4
18+
- name: Download build artifacts from CI
19+
uses: actions/download-artifact@v3
1720
with:
18-
python-version: "3.11"
19-
20-
- name: Install uv
21-
run: |
22-
curl -LsSf https://astral.sh/uv/install.sh | sh
23-
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
24-
25-
- name: Install dependencies
26-
run: |
27-
uv sync
28-
29-
- name: Build package
30-
run: |
31-
uv build
21+
name: dist
22+
path: dist/
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
24+
run-id: ${{ github.event.workflow_run.id }}
3225

3326
- name: Publish to PyPI
3427
uses: pypa/gh-action-pypi-publish@release/v1

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,10 @@ To release a new version:
307307
git push origin 0.1.1
308308
```
309309
3. The GitHub Action will automatically:
310+
- Run all tests across Python versions (3.8-3.12)
311+
- Run linting and type checking
310312
- Build the package
311-
- Publish to PyPI
313+
- Publish to PyPI (only if all checks pass)
312314

313315
**Note:** Make sure to set the `PYPI_API_TOKEN` secret in your GitHub repository settings.
314316

0 commit comments

Comments
 (0)