-
Notifications
You must be signed in to change notification settings - Fork 74
137 lines (118 loc) · 4.17 KB
/
build.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
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
130
131
132
133
134
135
136
137
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.config.plat_name }}
strategy:
matrix:
config:
- os: ubuntu-16.04
plat_name: manylinux1_x86_64
- os: macos-10.15
plat_name: macosx_10_10_x86_64
- os: windows-2019
plat_name: win_amd64
fail-fast: true
runs-on: ${{ matrix.config.os }}
timeout-minutes: 180
steps:
- name: Configure git
run: git config --global core.symlinks true
- name: Clone repository
uses: actions/checkout@v1
- name: Install python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6.x
architecture: x64
- name: Install python 2.7
uses: actions/setup-python@v1
with:
python-version: 2.7.x
architecture: x64
- name: Build wheelhouse
run: |
python3 -m pip install setuptools wheel
mkdir wheelhouse
python3 helpers/build_package.py wheel wheelhouse
shell: bash
- name: Archive wheelhouse
uses: actions/upload-artifact@v2
with:
name: package-${{ matrix.config.plat_name }}
path: wheelhouse
- name: Check the wheel
if: matrix.config.plat_name == 'manylinux1_x86_64'
run: |
python3 -m pip install auditwheel twine readme_renderer[md]
auditwheel show wheelhouse/*.whl
twine check wheelhouse/*.whl
- name: Test
run: |
python3 -m pip install pytest wheelhouse/*.whl
pytest tests
shell: bash
build-on-alpine:
name: alpine_x86_64
runs-on: ubuntu-latest
container:
image: nicolassqreen/azure-pipelines-container-alpine-python:3.12
timeout-minutes: 180
steps:
- name: Clone repository
uses: actions/checkout@v1
- name: Download V8 sources
uses: docker://python:2
with:
args: python helpers/v8_build.py --no-build --no-sysroot
- name: Prepare Aline Linux build environment
run: |
sudo apk -U add samurai llvm lld linux-headers binutils-gold
cp -f /usr/local/bin/gn py_mini_racer/extension/v8/buildtools/linux64/gn
rm -f py_mini_racer/extension/depot_tools/ninja
- name: Build the extension
run: |
python helpers/v8_build.py --no-update --no-sysroot --target py_mini_racer_shared_lib
cp py_mini_racer/extension/out/libmini_racer.so py_mini_racer/libmini_racer.muslc.so
- name: Build the wheelhouse
run: |
sudo apk add py3-pip py3-wheel
mkdir wheelhouse
python3 setup.py sdist --dist-dir wheelhouse
- name: Archive wheelhouse
uses: actions/upload-artifact@v2
with:
name: package-alpine_x86_64
path: wheelhouse
- name: Test
run: |
python3 -m pip install pytest wheelhouse/*.tar.gz
pytest tests
release:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [build-on-alpine, build]
steps:
- name: Download packages
uses: actions/download-artifact@v2
with:
path: tmp
- name: Move packages to the wheelhouse
run: |
mkdir wheelhouse
find tmp -name '*.whl' -exec mv {} wheelhouse \;
find tmp -name '*.tar.gz' -exec mv {} wheelhouse \;
shell: bash
- name: Publish 📦 to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: wheelhouse/