-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (93 loc) · 2.46 KB
/
Copy pathci-cd.yaml
File metadata and controls
102 lines (93 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI/CD
on:
push:
branches: ["master"]
tags: ["*"]
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"
enable-cache: true
- run: uv sync --frozen --group lint
test:
runs-on: ubuntu-24.04
needs: lint
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --frozen --group lint --group test
- run: uv run pytest -q
build:
runs-on: ubuntu-24.04
needs: test
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"
enable-cache: true
- run: uv sync --frozen
- run: uv build
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
docs:
runs-on: ubuntu-24.04
needs: lint
if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"
enable-cache: true
- run: uv sync --frozen --group docs
- run: uv run mkdocs build --config-file mkdocs.yaml
working-directory: .config
release:
runs-on: ubuntu-24.04
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: asimov-platform/release-action@v2
with:
app_id: ${{ secrets.APP_ID }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
changelog-path: CHANGES.md
compute-checksum: false
publish:
runs-on: ubuntu-24.04
needs: release
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
continue-on-error: true
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.13"
enable-cache: true
- env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish --token $UV_PUBLISH_TOKEN dist/*
working-directory: .