Skip to content

Commit 5f5c8c5

Browse files
committed
ci: add GitHub automation
Run the quality gate in CI and validate release artifacts with small focused workflows.
1 parent d2478d6 commit 5f5c8c5

3 files changed

Lines changed: 96 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-python@v6
19+
with:
20+
python-version-file: .python-version
21+
- uses: astral-sh/setup-uv@v7
22+
with:
23+
enable-cache: true
24+
- name: Build wheel and sdist
25+
run: make build
26+
- name: Smoke-test built wheel
27+
run: |
28+
python -m venv /tmp/python-template-wheel-test
29+
/tmp/python-template-wheel-test/bin/pip install dist/*.whl
30+
/tmp/python-template-wheel-test/bin/python-template --help
31+
- name: Upload build artifacts
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: python-package-dist
35+
path: dist/

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
quality:
15+
name: quality (py${{ matrix.python-version }})
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
python-version: ['3.11', '3.12', '3.13']
21+
steps:
22+
- uses: actions/checkout@v6
23+
- uses: actions/setup-python@v6
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- uses: astral-sh/setup-uv@v7
27+
with:
28+
enable-cache: true
29+
- name: Sync dependencies
30+
run: uv sync --group dev --frozen
31+
- name: Run quality gate
32+
run: make check

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
release-artifacts:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-python@v6
18+
with:
19+
python-version-file: .python-version
20+
- uses: astral-sh/setup-uv@v7
21+
with:
22+
enable-cache: true
23+
- name: Build release artifacts
24+
run: make build
25+
- name: Upload release artifacts
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: python-template-release-${{ github.ref_name }}
29+
path: dist/

0 commit comments

Comments
 (0)