Skip to content

Commit 3de1cde

Browse files
add github workflows
1 parent ceb00a3 commit 3de1cde

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/ci.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI & Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test:
10+
name: Run Tests
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.13"
21+
22+
- name: Install uv
23+
run: pip install uv
24+
25+
- name: Install dependencies
26+
run: uv venv && uv sync
27+
28+
- name: Run tests
29+
run: uv add pytest
30+
31+
release:
32+
name: Create GitHub Release
33+
needs: test
34+
if: github.ref == 'refs/heads/master'
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v4
40+
41+
- name: Get version from pyproject.toml
42+
id: get_version
43+
run: |
44+
version=$(grep -m1 '^version =' pyproject.toml | cut -d'"' -f2)
45+
echo "version=$version" >> "$GITHUB_OUTPUT"
46+
47+
- name: Create Git tag
48+
run: |
49+
git config user.name "GitHub Actions"
50+
git config user.email "actions@github.com"
51+
git tag "v${{ steps.get_version.outputs.version }}"
52+
git push origin "v${{ steps.get_version.outputs.version }}"
53+
54+
- name: Create GitHub Release
55+
uses: softprops/action-gh-release@v1
56+
with:
57+
tag_name: v${{ steps.get_version.outputs.version }}
58+
name: Release v${{ steps.get_version.outputs.version }}
59+
generate_release_notes: true
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+

0 commit comments

Comments
 (0)