-
Notifications
You must be signed in to change notification settings - Fork 613
164 lines (152 loc) · 4.9 KB
/
release.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: addons-release
on:
release:
types: [published]
tags:
- v*
push:
branches:
- master
- r*
pull_request:
branches:
- master
- r*
env:
BAZEL_VERSION: 1.1.0
jobs:
manylinux-cpu-release-test:
name: Test release on Ubuntu
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Release test Ubuntu
run: |
set -x -e
bash tools/run_cpu_tests.sh
manylinux-release-wheel:
name: Build release wheels for manylinux2010
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.5
- name: Build manylinux2010 wheels
run: |
docker run -e TF_NEED_CUDA=1 -v ${PWD}:/addons -w /addons \
tensorflow/tensorflow:2.1.0-custom-op-gpu-ubuntu16 \
tools/ci_build/builds/release_linux.sh
sudo apt-get install patchelf
python3 -m pip install -U auditwheel==2.0.0
tools/ci_build/builds/tf_auditwheel_patch.sh
for f in artifacts/*.whl; do
auditwheel repair --plat manylinux2010_x86_64 $f
done
ls -al wheelhouse/
- uses: actions/upload-artifact@v1
with:
name: ${{ runner.os }}-wheels
path: wheelhouse
macos-release-wheel:
name: Build release wheels for macOS
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.5', '3.6', '3.7']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build macOS wheels
if: github.event_name == 'release' || matrix.python-version == '3.5'
run: |
python3 --version
python3 -m pip install delocate wheel setuptools
bash tools/ci_testing/install_bazel_macos.sh $BAZEL_VERSION
bash tools/ci_testing/addons_cpu.sh
bazel build \
-c opt \
--copt -mmacosx-version-min=10.13 \
--linkopt -mmacosx-version-min=10.13 \
--noshow_progress \
--noshow_loading_progress \
--verbose_failures \
--test_output=errors \
build_pip_pkg
bazel-bin/build_pip_pkg artifacts
for f in artifacts/*.whl; do
delocate-wheel -w wheelhouse $f
done
- uses: actions/upload-artifact@v1
if: github.event_name == 'release' || matrix.python-version == '3.5'
with:
name: ${{ runner.os }}-wheels
path: wheelhouse
windows-release-wheel:
name: Build release wheels for Windows
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.5', '3.6', '3.7']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Build Windows wheels
env:
TF_NEED_CUDA: 0
BAZEL_VC: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/"
shell: bash
if: github.event_name == 'release' || matrix.python-version == '3.5'
run: |
python -m pip install wheel setuptools
curl -sSOL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-windows-x86_64.exe
export BAZEL_PATH=/d/a/addons/addons/bazel-${BAZEL_VERSION}-windows-x86_64.exe
bash ./tools/ci_testing/addons_cpu.sh
./bazel-${BAZEL_VERSION}-windows-x86_64.exe build \
-c opt \
--enable_runfiles \
--noshow_progress \
--noshow_loading_progress \
--verbose_failures \
--test_output=errors \
build_pip_pkg
bazel-bin/build_pip_pkg artifacts
- uses: actions/upload-artifact@v1
if: github.event_name == 'release' || matrix.python-version == '3.5'
with:
name: ${{ runner.os }}-wheels
path: artifacts
upload-wheels:
name: Publish wheels to PyPi
needs: [manylinux-release-wheel, macos-release-wheel, windows-release-wheel]
runs-on: ubuntu-18.04
steps:
- uses: actions/download-artifact@v1
with:
name: Linux-wheels
path: Linux-wheels
- uses: actions/download-artifact@v1
with:
name: macOS-wheels
path: macOS-wheels
- uses: actions/download-artifact@v1
with:
name: Windows-wheels
path: Windows-wheels
- run: |
set -e -x
mkdir -p dist
cp Linux-wheels/*.whl dist/
cp macOS-wheels/*.whl dist/
cp Windows-wheels/*.whl dist/
ls -la dist/
sha256sum dist/*.whl
- uses: pypa/gh-action-pypi-publish@master
if: github.event_name == 'release'
with:
user: __token__
password: ${{ secrets.pypi_token }}