-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (80 loc) · 2.87 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
name: Build TensorFlow
on:
push:
branches:
- main
- elizabeth/add-windows-linux-tensorflow-conda-package
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-22.04", "windows-2022"]
steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v4
# # Enable Windows Long Path Support
# - name: Enable Windows Long Path Support
# if: matrix.os == 'windows-2022'
# run: |
# reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
# shell: powershell
# Setup Miniconda
- name: Setup Miniconda
# https://github.com/conda-incubator/setup-miniconda
uses: conda-incubator/[email protected]
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
# Create a shortened link on Windows
- name: Create shortened link (Windows)
if: matrix.os == 'windows-2022'
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\c
robocopy $PWD C:\c /E /NFL /NDL /NJH /NJS /NC /NS /NP
# Build conda package
- name: Build conda package (Windows)
if: matrix.os == 'windows-2022'
shell: powershell
run: |
subst X: $PWD
conda build C:\c\.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 .conda.tensorflow --output-folder build.tensorflow -c conda-forge
# # Upload conda package
# - name: Upload to Anaconda (Windows)
# if: matrix.os == 'windows-2022'
# env:
# ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
# shell: powershell
# run: |
# anaconda login --username sleap-deps --password "$env:ANACONDA_LOGIN"
# anaconda -v upload "build.tensorflow\win-64\*.tar.bz2" --label dev --channel sleap-deps
# anaconda logout
# - name: Upload to Anaconda (Ubuntu)
# if: matrix.os == 'ubuntu-22.04'
# env:
# ANACONDA_LOGIN: ${{ secrets.ANACONDA_LOGIN }}
# shell: bash -l {0}
# run: |
# anaconda login --username sleap-deps --password "$ANACONDA_LOGIN"
# anaconda -v upload build.tensorflow/linux-64/*.tar.bz2 --label dev --channel sleap-deps
# anaconda logout