-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 3.54 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Build TensorFlow
on:
push:
branches:
- main
- elizabeth/add-windows-linux-tensorflow-conda-package
paths:
- ".github/workflows/build_tensorflow.yml"
- ".conda.tensorflow/**"
- ".conda.tensorflow_macos/**"
- "environment.tensorflow.yml"
- "requirements.tensorflow.txt"
- "requirements.tensorflow_macos.txt"
jobs:
build:
name: Build package (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04', 'windows-2022', 'macos-14']
steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v4
- name: Make conda prefix directory (Windows)
if: matrix.os == 'windows-2022'
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\c
# https://github.com/conda-incubator/setup-miniconda?tab=readme-ov-file#use-a-different-environment-name-or-path
- name: Setup Miniconda (Windows)
if: matrix.os == 'windows-2022'
uses: conda-incubator/setup-miniconda@v3.0.3
with:
python-version: "3.10"
environment-file: environment.tensorflow.yml
activate-environment: C:\c\tf
- name: Setup Miniconda (not Windows)
if: matrix.os != 'windows-2022'
uses: conda-incubator/setup-miniconda@v3.0.3
with:
python-version: "3.10"
environment-file: environment.tensorflow.yml
activate-environment: tf
- name: Print environment info
shell: bash -l {0}
run: |
which python
conda info
conda list
- name: Build conda package (Windows)
if: matrix.os == 'windows-2022'
shell: powershell
run: |
conda build --debug .conda.tensorflow --output-folder C:\c\build.tensorflow -c conda-forge
- name: Build conda package (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash -l {0}
run: |
conda build --debug .conda.tensorflow --output-folder build.tensorflow -c conda-forge
# https://github.com/anaconda/anaconda-client/issues/529
- name: Upload to Anaconda (Windows)
if: matrix.os == 'windows-2022'
env:
ANACONDA_PASSWORD: ${{ secrets.ANACONDA_PASSWORD }}
shell: powershell
run: |
anaconda login --username sleap-deps --password "$ANACONDA_PASSWORD"
anaconda -v upload "C:\c\build.tensorflow\win-64\*.tar.bz2" --label dev --user sleap-deps
anaconda logout
- name: Upload to Anaconda (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
env:
ANACONDA_PASSWORD: ${{ secrets.ANACONDA_PASSWORD }}
shell: bash -l {0}
run: |
anaconda login --username sleap-deps --password "$ANACONDA_PASSWORD"
anaconda -v upload build.tensorflow/linux-64/*.tar.bz2 --label dev --user sleap-deps
anaconda logout
- name: Build conda package (MacOS)
if: matrix.os == 'macos-14'
shell: bash -l {0}
run: |
conda build --debug .conda.tensorflow_macos --output-folder build.tensorflow_macos -c conda-forge
- name: Upload to Anaconda (MacOS)
if: matrix.os == 'macos-14'
env:
ANACONDA_PASSWORD: ${{ secrets.ANACONDA_PASSWORD }}
shell: bash -l {0}
run: |
anaconda login --username sleap-deps --password "$ANACONDA_PASSWORD"
anaconda -v upload build.tensorflow_macos/osx-arm64/*.tar.bz2 --label dev --user sleap-deps
anaconda logout