Build when pushing to current branch #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build TensorFlow | |
on: | |
push: | |
branches: | |
- main | |
- elizabeth/Change-Tensorflow-version | |
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-22.04", "windows-2022"] | |
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-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 | |
# - 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-2022' | |
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-22.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 |