Skip to content

go back to 2.9.0

go back to 2.9.0 #7

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@v3
# 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/setup-miniconda@v3.0.3
with:
python-version: "3.10"
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-2022'
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-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