forked from tensorflow/io
-
Notifications
You must be signed in to change notification settings - Fork 2
791 lines (769 loc) · 28.7 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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
name: GitHub CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
REPO_NAME: ${{ github.repository }}
EVENT_NAME: ${{ github.event_name }}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Lint Script for Bazel/Pyupgrade/Black/Clang
run: |
set -x -e
git log --pretty -1
BAZEL_OS=$(uname | tr '[:upper:]' '[:lower:]')
BAZEL_VERSION=$(cat .bazelversion)
curl -sSOL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh
sudo bash -e bazel-${BAZEL_VERSION}-installer-${BAZEL_OS}-x86_64.sh
sudo python3 -m pip install -U numpy
bazel run -s --verbose_failures --experimental_repo_remote_exec //tools/lint:check -- bazel pyupgrade black clang
- name: Run Lint Script for Docs
run: |
set -x -e
git log --pretty -1
sudo python3 --version
sudo python3 -m pip install dataclasses
sudo python3 -m pip install setuptools
sudo python3 -m pip install -U git+https://github.com/tensorflow/docs
find docs -name '*.ipynb' | xargs python3 -m tensorflow_docs.tools.nbfmt
echo "Check for failed fmt: "
git status --untracked-files=no --porcelain
[ -z "$(git status --untracked-files=no --porcelain)" ] || exit 1
find docs -name '*.ipynb' | xargs python3 -m tensorflow_docs.tools.nblint --arg=repo:tensorflow/io
echo "Check for failed lint: "
git status --untracked-files=no --porcelain
[ -z "$(git status --untracked-files=no --porcelain)" ] || exit 1
macos:
name: macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: GCP
run: |
cat > service_account_creds.json << EOF
${{ secrets.GCP_CREDS }}
EOF
- name: macOS
run: |
set -x -e
export BAZEL_OPTIMIZATION="--config=cache"
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
fi
echo "Bring /usr/bin to front as GitHub does not use system python3 by default"
export PATH=/usr/bin:$PATH
echo $PATH
python3 --version
python3 -c 'import site; print(site.getsitepackages())'
python3 .github/workflows/build.instruction.py --sudo=true docs/development.md "#### macOS" > source.sh
bash -x -e source.sh
python3 -c 'import tensorflow as tf; print(tf.version.VERSION)'
linux:
name: Linux
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
env:
REPO_NAME: ${{ env.REPO_NAME }}
EVENT_NAME: ${{ env.EVENT_NAME }}
steps:
- uses: actions/checkout@v2
- name: GCP
run: |
cat > service_account_creds.json << EOF
${{ secrets.GCP_CREDS }}
EOF
- name: Ubuntu 20.04
shell: bash
run: |
set -x -e
export BAZEL_OPTIMIZATION="--config=cache"
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
fi
apt update
apt-get install -y python3
python3 .github/workflows/build.instruction.py docs/development.md "##### Ubuntu 20.04" > source.sh
cat source.sh
bash -x -e source.sh
macos-bazel:
name: Bazel macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: GCP
run: |
cat > service_account_creds.json << EOF
${{ secrets.GCP_CREDS }}
EOF
- name: Bazel on macOS
run: |
set -x -e
export BAZEL_OPTIMIZATION="--config=optimization --config=cache"
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
fi
echo "Bring /usr/bin to front as GitHub does not use system python3 by default"
export PATH=/usr/bin:$PATH
sudo -E bash -e .github/workflows/build.bazel.sh
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-bazel-bin
path: |
build/tensorflow_io
build/tensorflow_io_gcs_filesystem
macos-wheel:
name: Wheel ${{ matrix.python }} macOS
needs: macos-bazel
runs-on: macos-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-bazel-bin
path: bazel-bin
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Wheel ${{ matrix.python }} macOS
run: |
set -x -e
python -m pip install -U wheel setuptools
python --version
python setup.py --data bazel-bin -q bdist_wheel --plat-name macosx_10_14_x86_64
rm -rf build
python setup.py --project tensorflow-io-gcs-filesystem --data bazel-bin -q bdist_wheel --plat-name macosx_10_14_x86_64
- name: Auditwheel ${{ matrix.python }} macOS
run: |
set -x -e
python -m pip install twine delocate
delocate-wheel --version
ls dist/*
for f in dist/*.whl; do
delocate-wheel -w wheelhouse $f
done
ls wheelhouse/*
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-${{ matrix.python }}-wheel
path: wheelhouse
macos-test:
name: Test ${{ matrix.python }} macOS
needs: macos-wheel
runs-on: macos-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-${{ matrix.python }}-wheel
path: wheelhouse
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- run: |
set -x -e
python -m pip install -U wheel setuptools
python --version
- name: Setup ${{ matrix.python }} macOS
run: |
set -x -e
bash -x -e tests/test_kafka/kafka_test.sh
bash -x -e tests/test_azure/start_azure.sh
bash -x -e tests/test_gcloud/test_pubsub_bigtable.sh
bash -x -e tests/test_pulsar/pulsar_test.sh
- name: Install ${{ matrix.python }} macOS
run: |
set -x -e
python --version
df -h
(cd wheelhouse && python -m pip install tensorflow_io_gcs_filesystem-*.whl)
(cd wheelhouse && python -m pip install tensorflow_io-*.whl)
- name: Test ${{ matrix.python }} macOS
run: |
set -x -e
python --version
bash -x -e .github/workflows/build.wheel.sh python
linux-bazel:
name: Bazel Linux
runs-on: ubuntu-latest
container:
image: gcr.io/tensorflow-testing/nosla-ubuntu16.04-manylinux2010@sha256:3a9b4820021801b1fa7d0592c1738483ac7abc209fc6ee8c9ef06cf2eab2d170
env:
REPO_NAME: ${{ env.REPO_NAME }}
EVENT_NAME: ${{ env.EVENT_NAME }}
steps:
- uses: actions/checkout@v2
- name: GCP
run: |
cat > service_account_creds.json << EOF
${{ secrets.GCP_CREDS }}
EOF
- name: Bazel on Linux
shell: bash
run: |
set -x -e
export BAZEL_OPTIMIZATION="--config=optimization --config=linux_ci --config=cache"
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
fi
bash -x -e .github/workflows/build.bazel.sh
sudo cp .bazelrc build/tensorflow_io/
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-bazel-bin
path: |
build/tensorflow_io
build/tensorflow_io_gcs_filesystem
linux-wheel:
name: Wheel ${{ matrix.python }} Linux
needs: linux-bazel
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-bazel-bin
path: bazel-bin
- name: Wheel ${{ matrix.python }} Linux
run: |
set -x -e
mv bazel-bin/tensorflow_io/.bazelrc .
docker run -i --rm --user $(id -u):$(id -g) -v /etc/password:/etc/password -v $PWD:/v -w /v --net=host python:${{ matrix.python }}-slim python setup.py --data bazel-bin -q bdist_wheel
rm -rf build
docker run -i --rm --user $(id -u):$(id -g) -v /etc/password:/etc/password -v $PWD:/v -w /v --net=host python:${{ matrix.python }}-slim python setup.py --project tensorflow-io-gcs-filesystem --data bazel-bin -q bdist_wheel
- name: Auditwheel ${{ matrix.python }} Linux
run: |
set -x -e
ls dist/*
for f in dist/*.whl; do
docker run -i --rm -v $PWD:/v -w /v --net=host quay.io/pypa/manylinux2010_x86_64 bash -x -e /v/tools/build/auditwheel repair --plat manylinux2010_x86_64 $f
done
sudo chown -R $(id -nu):$(id -ng) .
ls wheelhouse/*
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-${{ matrix.python }}-wheel
path: wheelhouse
linux-test:
name: Test ${{ matrix.python }} Linux
needs: linux-wheel
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-${{ matrix.python }}-wheel
path: wheelhouse
- name: Setup Linux
run: |
set -x -e
bash -x -e .github/workflows/build.space.sh
bash -x -e tests/test_pulsar/pulsar_test.sh
bash -x -e tests/test_kafka/kafka_test.sh
bash -x -e tests/test_aws/aws_test.sh
bash -x -e tests/test_gcloud/test_pubsub_bigtable.sh
bash -x -e tests/test_prometheus/prometheus_test.sh start
bash -x -e tests/test_elasticsearch/elasticsearch_test.sh start
bash -x -e tests/test_mongodb/mongodb_test.sh start
bash -x -e tests/test_azure/start_azure.sh
bash -x -e tests/test_sql/sql_test.sh
bash -x -e tests/test_gcloud/test_gcs.sh gcs-emulator
bash -x -e tests/test_hdfs/hdfs_test.sh
- name: Test Linux
run: |
set -x -e
df -h
docker run -i --rm -v $PWD:/v -w /v --net=host \
buildpack-deps:20.04 \
bash -x -e .github/workflows/build.wheel.sh python${{ matrix.python }}
windows-bazel:
name: Bazel Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: GCP
shell: bash
run: |
cat > service_account_creds.json << EOF
${{ secrets.GCP_CREDS }}
EOF
- name: Bazel on Windows
env:
BAZEL_VC: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/"
shell: cmd
run: |
@echo on
set "BAZEL_OPTIMIZATION=--config=cache"
if "%EVENT_NAME%" == "push" (
if "%REPO_NAME%" == "tensorflow/io" (
set "BAZEL_OPTIMIZATION=%BAZEL_OPTIMIZATION% --remote_upload_local_results=true --google_credentials=service_account_creds.json"
)
)
set /P BAZEL_VERSION=< .bazelversion
curl -sSL -o bazel.exe https://github.com/bazelbuild/bazel/releases/download/%BAZEL_VERSION%/bazel-%BAZEL_VERSION%-windows-x86_64.exe
bazel version
python3 --version
python3 -m pip install wheel setuptools
python3 -m pip --version
python3 setup.py --install-require | xargs python3 -m pip install
python3 tools/build/configure.py
cat .bazelrc
bazel build -s %BAZEL_OPTIMIZATION% //tensorflow_io:python/ops/libtensorflow_io.so //tensorflow_io:python/ops/libtensorflow_io_plugins.so //tensorflow_io_gcs_filesystem/...
if %errorlevel% neq 0 exit /b %errorlevel%
mkdir build
cp -r bazel-bin/tensorflow_io build
cp -r bazel-bin/tensorflow_io_gcs_filesystem build
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-bazel-bin
path: |
build/tensorflow_io
build/tensorflow_io_gcs_filesystem
windows-wheel:
name: Wheel ${{ matrix.python }} Windows
needs: windows-bazel
runs-on: windows-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-bazel-bin
path: bazel-bin
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Wheel ${{ matrix.python }} Windows
shell: cmd
run: |
@echo on
python --version
python -m pip install -U wheel setuptools
python setup.py --data bazel-bin -q bdist_wheel
rm -rf build
python setup.py --project tensorflow-io-gcs-filesystem --data bazel-bin -q bdist_wheel
ls -la dist
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-${{ matrix.python }}-wheel
path: dist
windows-test:
name: Test ${{ matrix.python }} Windows
needs: windows-wheel
runs-on: windows-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-${{ matrix.python }}-wheel
path: wheel
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- uses: actions/setup-node@v1
with:
node-version: '8.x'
- name: Setup ${{ matrix.python }} Windows
shell: cmd
run: |
@echo on
bash -x -e tests/test_azure/start_azure.sh
- name: Install ${{ matrix.python }} Windows
shell: cmd
run: |
@echo on
python --version
(cd wheel && ls tensorflow_io_gcs_filesystem-*.whl | xargs python -m pip install && cd ..)
(cd wheel && ls tensorflow_io-*.whl | xargs python -m pip install && cd ..)
- name: Test ${{ matrix.python }} Windows
shell: cmd
run: |
@echo on
python --version
python -m pip install -U pytest-benchmark
python -m pip install google-cloud-bigquery-storage==0.7.0 google-cloud-bigquery==1.22.0 fastavro
rm -rf tensorflow_io tensorflow_io_gcs_filesystem
cd tests
python -m pytest -s -v test_lmdb.py
if %errorlevel% neq 0 exit /b %errorlevel%
python -m pytest -s -v test_image.py -k "webp or ppm or bmp or bounding or exif or hdr or openexr or tiff or avif"
if %errorlevel% neq 0 exit /b %errorlevel%
python -m pytest -s -v test_serialization.py
if %errorlevel% neq 0 exit /b %errorlevel%
python -m pytest -s -v test_io_dataset.py -k "numpy or hdf5 or audio or to_file"
if %errorlevel% neq 0 exit /b %errorlevel%
python -m pytest -s -v test_http.py
if %errorlevel% neq 0 exit /b %errorlevel%
python -m pytest -s -v test_bigquery.py
if %errorlevel% neq 0 exit /b %errorlevel%
python -m pytest -s -v test_dicom.py
if %errorlevel% neq 0 exit /b %errorlevel%
release:
name: Release
if: github.event_name == 'push'
needs: [lint, linux-test, macos-test, windows-test]
runs-on: ubuntu-18.04
steps:
- uses: actions/download-artifact@v1
with:
name: macOS-3.6-wheel
path: macOS-3.6-wheel
- uses: actions/download-artifact@v1
with:
name: macOS-3.7-wheel
path: macOS-3.7-wheel
- uses: actions/download-artifact@v1
with:
name: macOS-3.8-wheel
path: macOS-3.8-wheel
- uses: actions/download-artifact@v1
with:
name: macOS-3.9-wheel
path: macOS-3.9-wheel
- uses: actions/download-artifact@v1
with:
name: Linux-3.6-wheel
path: Linux-3.6-wheel
- uses: actions/download-artifact@v1
with:
name: Linux-3.7-wheel
path: Linux-3.7-wheel
- uses: actions/download-artifact@v1
with:
name: Linux-3.8-wheel
path: Linux-3.8-wheel
- uses: actions/download-artifact@v1
with:
name: Linux-3.9-wheel
path: Linux-3.9-wheel
- uses: actions/download-artifact@v1
with:
name: Windows-3.6-wheel
path: Windows-3.6-wheel
- uses: actions/download-artifact@v1
with:
name: Windows-3.7-wheel
path: Windows-3.7-wheel
- uses: actions/download-artifact@v1
with:
name: Windows-3.8-wheel
path: Windows-3.8-wheel
- uses: actions/download-artifact@v1
with:
name: Windows-3.9-wheel
path: Windows-3.9-wheel
- run: |
set -e -x
mkdir -p wheelhouse
cp macOS-3.6-wheel/*.whl wheelhouse/
cp macOS-3.7-wheel/*.whl wheelhouse/
cp macOS-3.8-wheel/*.whl wheelhouse/
cp macOS-3.9-wheel/*.whl wheelhouse/
cp Linux-3.6-wheel/*.whl wheelhouse/
cp Linux-3.7-wheel/*.whl wheelhouse/
cp Linux-3.8-wheel/*.whl wheelhouse/
cp Linux-3.9-wheel/*.whl wheelhouse/
cp Windows-3.6-wheel/*.whl wheelhouse/
cp Windows-3.7-wheel/*.whl wheelhouse/
cp Windows-3.8-wheel/*.whl wheelhouse/
cp Windows-3.9-wheel/*.whl wheelhouse/
ls -la wheelhouse/
sha256sum wheelhouse/*.whl
- uses: actions/upload-artifact@v2
with:
name: tensorflow-io-release
path: wheelhouse
docker-release:
name: Docker Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [lint, linux-test, macos-test, windows-test]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
- run: |
set -e -x
docker login --username tfsigio --password ${{ secrets.DOCKER_PASSWORD }}
bash -x -e tools/docker/tests/dockerfile_cpu_test.sh
docker push tfsigio/tfio:latest
python --version
TFIO_VERSION=$(python setup.py --version | tail -1)
docker tag tfsigio/tfio:latest tfsigio/tfio:${TFIO_VERSION}
docker push tfsigio/tfio:${TFIO_VERSION}
bash -x -e tools/docker/tests/dockerfile_devel_test.sh
docker push tfsigio/tfio:latest-devel
build-number:
name: Build Number
if: github.event_name == 'push'
runs-on: ubuntu-18.04
steps:
- run: |
set -e -x
BUILD_NUMBER=$(date "+%Y%m%d%H%M%S")
echo ${BUILD_NUMBER} > BUILD_NUMBER
- uses: actions/upload-artifact@v2
with:
name: BUILD_NUMBER
path: BUILD_NUMBER
macos-nightly:
name: Nightly ${{ matrix.python }} macOS
if: github.event_name == 'push'
needs: [build-number, macos-wheel]
runs-on: macos-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/download-artifact@v1
with:
name: BUILD_NUMBER
- uses: einaregilsson/build-number@v3
- run: echo "Build number is $BUILD_NUMBER"
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-bazel-bin
path: bazel-bin
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Wheel ${{ matrix.python }} macOS
run: |
set -x -e
python -m pip install -U wheel setuptools
python --version
python setup.py --data bazel-bin -q bdist_wheel --plat-name macosx_10_14_x86_64 --nightly $BUILD_NUMBER
rm -rf build
python setup.py --project tensorflow-io-gcs-filesystem --data bazel-bin -q bdist_wheel --plat-name macosx_10_14_x86_64 --nightly $BUILD_NUMBER
- name: Auditwheel ${{ matrix.python }} macOS
run: |
set -x -e
python -m pip install twine delocate
delocate-wheel --version
ls dist/*
for f in dist/*.whl; do
delocate-wheel -w wheelhouse $f
done
ls wheelhouse/*
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-${{ matrix.python }}-nightly
path: wheelhouse
linux-nightly:
name: Nightly ${{ matrix.python }} Linux
if: github.event_name == 'push'
needs: [build-number, linux-wheel]
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/download-artifact@v1
with:
name: BUILD_NUMBER
- uses: einaregilsson/build-number@v3
- run: echo "Build number is $BUILD_NUMBER"
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-bazel-bin
path: bazel-bin
- name: Wheel ${{ matrix.python }} Linux
run: |
set -x -e
mv bazel-bin/tensorflow_io/.bazelrc .
docker run -i --rm --user $(id -u):$(id -g) -v /etc/password:/etc/password -v $PWD:/v -w /v --net=host python:${{ matrix.python }}-slim python setup.py --data bazel-bin -q bdist_wheel --nightly $BUILD_NUMBER
rm -rf build
docker run -i --rm --user $(id -u):$(id -g) -v /etc/password:/etc/password -v $PWD:/v -w /v --net=host python:${{ matrix.python }}-slim python setup.py --project tensorflow-io-gcs-filesystem --data bazel-bin -q bdist_wheel --nightly $BUILD_NUMBER
- name: Auditwheel ${{ matrix.python }} Linux
run: |
set -x -e
ls dist/*
for f in dist/*.whl; do
docker run -i --rm -v $PWD:/v -w /v --net=host quay.io/pypa/manylinux2010_x86_64 bash -x -e /v/tools/build/auditwheel repair --plat manylinux2010_x86_64 $f
done
sudo chown -R $(id -nu):$(id -ng) .
ls wheelhouse/*
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-${{ matrix.python }}-nightly
path: wheelhouse
windows-nightly:
name: Nightly ${{ matrix.python }} Windows
if: github.event_name == 'push'
needs: [build-number, windows-wheel]
runs-on: windows-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/download-artifact@v1
with:
name: BUILD_NUMBER
- uses: einaregilsson/build-number@v3
- run: echo "Build number is $BUILD_NUMBER"
- uses: actions/checkout@v2
- uses: actions/download-artifact@v1
with:
name: ${{ runner.os }}-bazel-bin
path: bazel-bin
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Wheel ${{ matrix.python }} Windows
shell: cmd
run: |
@echo on
python --version
python -m pip install -U wheel setuptools
python setup.py --data bazel-bin -q bdist_wheel --nightly %BUILD_NUMBER%
rm -rf build
python setup.py --project tensorflow-io-gcs-filesystem --data bazel-bin -q bdist_wheel --nightly %BUILD_NUMBER%
ls -la dist
- uses: actions/upload-artifact@v2
with:
name: ${{ runner.os }}-${{ matrix.python }}-nightly
path: dist
nightly:
name: Nightly
if: github.event_name == 'push'
needs: [linux-nightly, macos-nightly, windows-nightly]
runs-on: ubuntu-18.04
steps:
- uses: actions/download-artifact@v1
with:
name: macOS-3.6-nightly
path: macOS-3.6-nightly
- uses: actions/download-artifact@v1
with:
name: macOS-3.7-nightly
path: macOS-3.7-nightly
- uses: actions/download-artifact@v1
with:
name: macOS-3.8-nightly
path: macOS-3.8-nightly
- uses: actions/download-artifact@v1
with:
name: macOS-3.9-nightly
path: macOS-3.9-nightly
- uses: actions/download-artifact@v1
with:
name: Linux-3.6-nightly
path: Linux-3.6-nightly
- uses: actions/download-artifact@v1
with:
name: Linux-3.7-nightly
path: Linux-3.7-nightly
- uses: actions/download-artifact@v1
with:
name: Linux-3.8-nightly
path: Linux-3.8-nightly
- uses: actions/download-artifact@v1
with:
name: Linux-3.9-nightly
path: Linux-3.9-nightly
- uses: actions/download-artifact@v1
with:
name: Windows-3.6-nightly
path: Windows-3.6-nightly
- uses: actions/download-artifact@v1
with:
name: Windows-3.7-nightly
path: Windows-3.7-nightly
- uses: actions/download-artifact@v1
with:
name: Windows-3.8-nightly
path: Windows-3.8-nightly
- uses: actions/download-artifact@v1
with:
name: Windows-3.9-nightly
path: Windows-3.9-nightly
- run: |
set -e -x
mkdir -p dist
cp macOS-3.6-nightly/tensorflow_io_nightly*.whl dist/
cp macOS-3.7-nightly/tensorflow_io_nightly*.whl dist/
cp macOS-3.8-nightly/tensorflow_io_nightly*.whl dist/
cp macOS-3.9-nightly/tensorflow_io_nightly*.whl dist/
cp Linux-3.6-nightly/tensorflow_io_nightly*.whl dist/
cp Linux-3.7-nightly/tensorflow_io_nightly*.whl dist/
cp Linux-3.8-nightly/tensorflow_io_nightly*.whl dist/
cp Linux-3.9-nightly/tensorflow_io_nightly*.whl dist/
cp Windows-3.6-nightly/tensorflow_io_nightly*.whl dist/
cp Windows-3.7-nightly/tensorflow_io_nightly*.whl dist/
cp Windows-3.8-nightly/tensorflow_io_nightly*.whl dist/
cp Windows-3.9-nightly/tensorflow_io_nightly*.whl dist/
ls -la dist/
sha256sum dist/*.whl
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.github_tensorflow_io_nightly }}
- run: |
set -e -x
rm -rf dist
mkdir -p dist
cp macOS-3.6-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp macOS-3.7-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp macOS-3.8-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp macOS-3.9-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Linux-3.6-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Linux-3.7-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Linux-3.8-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Linux-3.9-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Windows-3.6-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Windows-3.7-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Windows-3.8-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
cp Windows-3.9-nightly/tensorflow_io_gcs_filesystem_nightly*.whl dist/
ls -la dist/
sha256sum dist/*.whl
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.tensorflow_io_gcs_filesystem_nightly }}
docker-nightly:
name: Docker Nightly
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [linux-nightly, macos-nightly, windows-nightly]
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
- run: |
set -e -x
docker login --username tfsigio --password ${{ secrets.DOCKER_PASSWORD }}
python --version
bash -x -e tools/docker/tests/dockerfile_nightly_test.sh
docker push tfsigio/tfio:nightly