Skip to content

Use correct version number & reset build number #46

Use correct version number & reset build number

Use correct version number & reset build number #46

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
- 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 (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
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_API_TOKEN: ${{ secrets.ANACONDA_SLEAP_DEPS_TOKEN }}
shell: powershell
run: |
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_API_TOKEN: ${{ secrets.ANACONDA_SLEAP_DEPS_TOKEN }}
shell: bash -l {0}
run: |
anaconda -v upload build.tensorflow/linux-64/*.tar.bz2 --label dev --user sleap-deps
anaconda logout