This repository was archived by the owner on Jul 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
129 lines (125 loc) · 3.74 KB
/
ci.yaml
File metadata and controls
129 lines (125 loc) · 3.74 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
on:
push: {}
pull_request: {}
jobs:
ubuntu:
runs-on: ${{matrix.os}}
env:
PYVERSIONS: ${{matrix.pyversions}}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: "Build CI"
run: |
cd $GITHUB_WORKSPACE
./ci/build_linux.sh
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-20.04
pyversions: "python3.8 python3.9"
- os: ubuntu-22.04
pyversions: "python3.10"
windows:
runs-on: windows-2019
env:
CI_ARCH: ${{matrix.CI_ARCH}}
CI_WINDOWS: "1"
PYVERSION: ${{matrix.PYVERSION}}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache Pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{matrix.CI_ARCH}}
restore-keys: |
${{ runner.os }}-pip-${{matrix.CI_ARCH}}
- name: Configure MSVC Environment Variables
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\enterprise\VC\Auxiliary\Build\vcvars%CI_ARCH%.bat"
set > %GITHUB_ENV%
- name: Build python Wheels
shell: powershell
run: |
set-location $Env:GITHUB_WORKSPACE
./ci/build_python.ps1
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: python-wheels-win${{matrix.CI_ARCH}}-${{matrix.PYVERSION}}
path: dist/*
strategy:
fail-fast: true
matrix:
CI_ARCH: ["32", "64"]
PYVERSION: ["3.11", "3.10", "3.9", "3.8", "3.7"]
python_sdist:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build Python sdist
run: |
sudo apt update
cd $GITHUB_WORKSPACE
sudo apt-fast install -y virtualenv python3.9 python3.9-dev
cd $GITHUB_WORKSPACE
python synthizer-c/vendor.py synthizer-vendored
virtualenv -p python3.9 ./venvs/python3.9
source venvs/python3.9/bin/activate
pip install -U cython wheel scikit-build
# Don't build Synthizer just to get an sdist.
CI_SDIST=1 python setup.py sdist
deactivate
# Now try to build it, to make sure vendoring worked out.
virtualenv -p python3.9 ./venvs/python3.9-test
source venvs/python3.9-test/bin/activate
pip install dist/*
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: python-sdist
path: dist/*
deploy_pypi:
if: startsWith(github.ref, 'refs/tags') && !github.event_type != 'pull_request'
needs: ["windows", "python_sdist", "ubuntu"]
runs-on: ubuntu-20.04
steps:
- name: download artifact
uses: actions/download-artifact@v2
with:
name: ${{matrix.ARTIFACT}}
path: ~/artifacts
- name: Upload to Pypi
env:
TWINE_USERNAME: camlorn
TWINE_PASSWORD: ${{secrets.TWINE_PASSWORD}}
run: |
sudo pip3 install twine
twine upload /home/runner/artifacts/*
strategy:
fail-fast: true
max-parallel: 1
matrix:
ARTIFACT:
- python-wheels-win32-3.11
- python-wheels-win64-3.11
- python-wheels-win32-3.10
- python-wheels-win64-3.10
- python-wheels-win32-3.9
- python-wheels-win64-3.9
- python-wheels-win32-3.8
- python-wheels-win64-3.8
- python-wheels-win32-3.7
- python-wheels-win64-3.7
- python-sdist