Skip to content

Use anaconda password instead of token #48

Use anaconda password instead of token

Use anaconda password instead of token #48

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"

Check failure on line 31 in .github/workflows/build_tensorflow.yml

View workflow run for this annotation

GitHub Actions / Build TensorFlow

Invalid workflow file

The workflow is not valid. .github/workflows/build_tensorflow.yml (Line: 31, Col: 13): Unexpected symbol: '"windows-2022"'. Located at position 14 within expression: matrix.os == "windows-2022" .github/workflows/build_tensorflow.yml (Line: 38, Col: 13): Unexpected symbol: '"windows-2022"'. Located at position 14 within expression: 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/[email protected]
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/[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
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