-
Notifications
You must be signed in to change notification settings - Fork 1
140 lines (118 loc) · 4.55 KB
/
cibuildwheel.yml
File metadata and controls
140 lines (118 loc) · 4.55 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
130
131
132
133
134
135
136
137
138
139
140
name: cibuildwheel
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci_skip')"
strategy:
matrix:
os: [ ubuntu-18.04 ] # , windows-2019, macos-10.15 ]
py_version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: write_branchName_to_file
run: echo ${GITHUB_REF##*/} > branch_name.tmp
- name: Build wheels
uses: joerick/cibuildwheel@v1.10.0
env:
CIBW_ENVIRONMENT: "BRANCH_NAME=$(cat branch_name.tmp)"
CIBW_BUILD_VERBOSITY: 3
CIBW_BUILD: cp36-manylinux_x86_64 cp37-manylinux_x86_64 cp38-manylinux_x86_64 cp39-manylinux_x86_64
CIBW_SKIP: pp* cp27-manylinux* *-manylinux_{aarch64,ppc64le,s390x}
CIBW_ARCHS_LINUX: x86_64
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64:latest
CIBW_BEFORE_ALL: |
yum install bzip2 -y
pip install --upgrade pip
pip install cmake
yum install zlib-devel -y
yum install centos-release-scl-rh -y
yum install doxygen -y
yum install devtoolset-7-toolchain -y
yum groupinstall -y "development tools"
yum install boost-devel -y
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel
cmake -BKP_BUILD
cmake --build KP_BUILD -j4
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
upload_pypi_test:
needs: build_wheels
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
id: fetch_artifacts
with:
path: 'wheels/'
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_KPROCESSOR_API_KEY }} #PYPI_KPROCESSOR_API_KEY
repository_url: https://test.pypi.org/legacy/
packages_dir: ${{steps.fetch_artifacts.outputs.download-path}}/artifact/
skip_existing: true
verbose: true
upload_bintray:
needs: build_wheels
runs-on: ubuntu-18.04
if: "contains(github.event.head_commit.message, 'bintray')"
steps:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Extract branch name
if: github.event_name != 'pull_request'
shell: bash
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
# extract branch name on pull request
- name: Print branch name
if: github.event_name == 'pull_request'
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})"
- uses: actions/checkout@v1
- name: Fetch wheels from artifacts
id: fetch_artifacts
uses: actions/download-artifact@v2
with:
path: 'wheels/'
- run: |
kp_version=$(python version.py $BRANCH_NAME)
echo "::set-output name=kProcessor_version::$kp_version"
- name: Bintray
run: |
for whl_file in ${{steps.fetch_artifacts.outputs.download-path}}/artifact/*whl;
do
curl -T $whl_file -umr-eyes:${{ secrets.BINTRAY_API_KEY }} -H "X-Bintray-Override:1" -H "X-Bintray-Version:${{ steps.fetch_artifacts.outputs.kProcessor_version }}" -H "X-Bintray-Package:kProcessor" https://api.bintray.com/content/mr-eyes/wheels/
done
curl -X POST -umr-eyes:${{ secrets.BINTRAY_API_KEY }} https://api.bintray.com/content/mr-eyes/wheels/kProcessor/${{ steps.fetch_artifacts.outputs.kProcessor_version }}/publish
upload_pypi_release:
needs: build_wheels
runs-on: ubuntu-18.04
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
id: fetch_artifacts
with:
path: 'wheels/'
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_KPROCESSOR_API_KEY }}
packages_dir: ${{steps.fetch_artifacts.outputs.download-path}}/artifact/
skip_existing: true
verbose: true