-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (89 loc) · 3.2 KB
/
build_tensorflow.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
name: Build TensorFlow
on:
push:
branches:
- main
- talmo/update-tf
paths:
- '.github/workflows/build_tensorflow.yml'
- '.conda.tensorflow/**'
- 'environment.tensorflow.yml'
- 'requirements.tensorflow.txt'
jobs:
build:
name: Build package (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: ["ubuntu-20.04", "windows-2019", "macos-10.15"]
os: ["ubuntu-20.04", "windows-2019"]
steps:
# Setup
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment_build.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.tensorflow.yml', 'requirements.tensorflow.txt') }}
- name: Setup Miniconda
# https://github.com/conda-incubator/setup-miniconda
uses: conda-incubator/[email protected]
with:
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
environment-file: environment.tensorflow.yml
activate-environment: build_tensorflow
- name: Print environment info
shell: bash -l {0}
run: |
which python
conda info
# Build conda package
- name: Build conda package (Windows)
if: matrix.os == 'windows-2019'
shell: powershell
run: |
conda activate build_tensorflow
conda build .conda.tensorflow --output-folder build.tensorflow -c conda-forge
- name: Build conda package (Ubuntu)
if: matrix.os == 'ubuntu-20.04'
shell: bash -l {0}
run: |
conda build .conda.tensorflow --output-folder build.tensorflow -c conda-forge
# - name: Build conda package (Mac)
# if: matrix.os == 'macos-10.15'
# shell: bash -l {0}
# run: |
# conda build .conda.tensorflow --output-folder build.tensorflow
# Upload conda package
- name: Upload to Anaconda (Windows)
if: matrix.os == 'windows-2019'
env:
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
shell: powershell
run: |
anaconda login --username sleap --password "$env:ANACONDA_LOGIN"
anaconda -v upload "build.tensorflow\win-64\*.tar.bz2" --label dev
anaconda logout
- name: Upload to Anaconda (Ubuntu)
if: matrix.os == 'ubuntu-20.04'
env:
ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
shell: bash -l {0}
run: |
anaconda login --username sleap --password "$ANACONDA_LOGIN"
anaconda -v upload build.tensorflow/linux-64/*.tar.bz2 --label dev
anaconda logout
# - name: Upload to Anaconda (Mac)
# if: matrix.os == 'macos-10.15'
# env:
# ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
# shell: bash -l {0}
# run: |
# anaconda login --username sleap --password "$ANACONDA_LOGIN"
# anaconda -v upload build.tensorflow/osx-64/*.tar.bz2
# anaconda logout