forked from ctorney/matplotlib-backend-sixel
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 1.46 KB
/
python-app.yml
File metadata and controls
70 lines (66 loc) · 1.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
name: test and publish
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- name: Set up Python
run: |
uv python install
uv venv
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install package
run: |
uv pip install .[dev]
- name: Check lint
run: |
codespell .
ruff check .
ruff format . --diff
- name: Test
run: |
coverage run -m pytest tests/unit/
coverage report
publish:
name: Publish
environment:
name: pypi
url: https://pypi.org/project/dot.py/
permissions:
id-token: write
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed to get version
- uses: astral-sh/setup-uv@v3
- name: Build
run: |
uv build
- name: Set up Python
run: |
uv python install
uv venv
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Validate Tag
run: |
uv pip install dist/*.whl
python3 tests/version.py
- name: Publish
run: |
uv publish --trusted-publishing always