-
Notifications
You must be signed in to change notification settings - Fork 53
59 lines (50 loc) · 1.33 KB
/
python-package.yml
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
name: Python Package
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python:
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install build dependencies
run: |
sudo apt-get install -qy \
gettext \
libgirepository1.0-dev
- run: pip install -U pip
- run: pip install setuptools wheel
- run: python setup.py sdist bdist_wheel
- run: pip install dist/*.whl
- run: pip install twine flake8
- run: twine check dist/*
- run: flake8
- run: python test/test_match.py
- uses: actions/upload-artifact@v4
with: {name: dist, path: dist/}
if: matrix.python == '3.12'
deploy:
name: Upload release
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v') && success()
environment:
name: pypi
permissions:
id-token: write
steps:
- uses: actions/[email protected]
with: {name: dist, path: dist/}
- uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/