-
Notifications
You must be signed in to change notification settings - Fork 613
154 lines (150 loc) · 5.11 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
name: addons-release
on:
release:
types: [published]
tags:
- v*
push:
branches:
- master
- r*
pull_request:
branches:
- master
- r*
permissions:
contents: read
env:
MIN_PY_VERSION: '3.9'
MAX_PY_VERSION: '3.11'
jobs:
test-with-bazel:
name: Test with bazel
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ env.MIN_PY_VERSION }}
- name: Build wheels
run: |
pip install --default-timeout=1000 -r tools/install_deps/pytest.txt -r tools/install_deps/tensorflow-cpu.txt -r requirements.txt
bash tools/install_deps/install_bazelisk.sh ./
python configure.py
bazel test -k --test_timeout 300,450,1200,3600 --test_output=errors //tensorflow_addons/...
release-wheel:
name: Test and build release wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
# To switch on windows-2022/latest, please verify the bazel version:
# https://github.com/bazelbuild/bazel/issues/14232#issuecomment-1011247429
os: ['macos-12', 'ubuntu-20.04']
# Removing windows builds due to broken upstream package https://github.com/tensorflow/tensorflow/issues/61830
# os: ['macos-12', 'windows-2019', 'ubuntu-20.04']
py-version: ['3.9', '3.10', '3.11']
tf-version: ['2.13.1', '2.14.0', '2.15.0']
cpu: ['x86']
include:
- os: 'macos-12'
cpu: 'arm64'
tf-version: '2.15.0'
py-version: '3.9'
- os: 'macos-12'
cpu: 'arm64'
tf-version: '2.15.0'
py-version: '3.10'
- os: 'macos-12'
cpu: 'arm64'
tf-version: '2.15.0'
py-version: '3.11'
fail-fast: false
steps:
- uses: actions/github-script@0.3.0
id: author-date
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const commit_details = await github.git.getCommit({owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha});
return commit_details.data.author.date
- if: matrix.tf-version != '2.15.0'
shell: bash
run: echo "SKIP_CUSTOM_OP_TESTS=--skip-custom-ops" >> $GITHUB_ENV
- if: github.event_name == 'push'
shell: bash
run: echo "NIGHTLY_FLAG=--nightly" >> $GITHUB_ENV
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}
- if: matrix.os != 'ubuntu-20.04'
name: Setup Bazel
# Ubuntu bazel is run inside of the docker image
run: bash tools/install_deps/install_bazelisk.sh ./
- name: Build wheels
env:
OS: ${{ runner.os }}
PY_VERSION: ${{ matrix.py-version }}
TF_VERSION: ${{ matrix.tf-version }}
NIGHTLY_TIME: ${{ steps.author-date.outputs.result }}
CPU: ${{ matrix.cpu }}
shell: bash
run: bash .github/workflows/make_wheel_${OS}_${CPU}.sh
- uses: actions/upload-artifact@v1
with:
name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel
path: wheelhouse
upload-wheels:
name: Publish wheels to PyPi
needs: [release-wheel, test-with-bazel]
runs-on: ubuntu-20.04
strategy:
matrix:
os: ['macOS', 'Linux']
# Removing windows builds due to broken upstream package https://github.com/tensorflow/tensorflow/issues/61830
# os: ['macOS', 'Windows', 'Linux']
py-version: ['3.9', '3.10', '3.11']
tf-version: ['2.15.0']
cpu: ['x86']
include:
- os: 'macOS'
cpu: 'arm64'
tf-version: '2.15.0'
py-version: '3.9'
- os: 'macOS'
cpu: 'arm64'
tf-version: '2.15.0'
py-version: '3.10'
- os: 'macOS'
cpu: 'arm64'
tf-version: '2.15.0'
py-version: '3.11'
fail-fast: false
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'release'
steps:
- uses: actions/download-artifact@v1
with:
name: ${{ matrix.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-${{ matrix.cpu }}-wheel
path: ./dist
- run: |
set -e -x
ls -la dist/
sha256sum dist/*.whl
- uses: pypa/gh-action-pypi-publish@v1.1.0
with:
user: __token__
password: ${{ secrets.pypi_token }}
upload-dev-container:
name: Upload dev container to DockerHub
needs: [release-wheel, test-with-bazel]
runs-on: ubuntu-20.04
env:
PY_VERSION: '3.9'
if: (github.event_name == 'push' && github.ref == 'refs/heads/master')
steps:
- uses: actions/checkout@v2
- run: |
set -e -x
echo ${{ secrets.DOCKER_PW }} | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin
bash .github/workflows/github_build_dev_container.sh
docker push tfaddons/dev_container:latest-gpu