-
Notifications
You must be signed in to change notification settings - Fork 12
106 lines (86 loc) · 2.46 KB
/
build.yaml
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
102
103
104
105
106
name: Build
on:
push:
branches: [ main ]
tags: [ "v*" ]
pull_request:
branches: [ main ]
jobs:
lint:
name: Run linter and formatter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tools
run: pip install flake8==4.0.1 yapf==0.32.0 mypy==0.942 toml==0.10.2
- name: Run flake8
run: flake8 setup.py animeface
- name: Run yapf
run: yapf -d -r setup.py animeface
- name: Run mypy
run: mypy --ignore-missing-imports animeface
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Build sdist
run: python3 setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Build wheels
uses: pypa/[email protected]
env:
# TODO: Remove this option adn build wheels for musllinux.
# Currently CLAPACK fails to build for musllinux due to lack of
# fpu_control.h.
CIBW_SKIP: "*-musllinux_*"
- uses: actions/upload-artifact@v4
with:
name: wheels
path: ./wheelhouse/*.whl
upload_pypi:
name: Upload to PyPI
runs-on: ubuntu-latest
needs:
- build_sdist
- build_wheels
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Download artifacts (sdist)
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Download artifacts (wheels)
uses: actions/download-artifact@v4
with:
name: wheels
path: dist
- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to Production PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist
user: __token__
password: ${{ secrets.PROD_PYPI_API_TOKEN }}