Skip to content

Commit

Permalink
Make conda prefix directory shorter again
Browse files Browse the repository at this point in the history
  • Loading branch information
roomrys committed Sep 12, 2024
1 parent 43164a5 commit 39b4275
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/build_tensorflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ jobs:
matrix:
os: ["ubuntu-22.04", "windows-2022", "macos-14"]
include:
- os-folder: win-64
- os-folder: linux-64
- build-folder: .conda.tensorflow
- os: "ubuntu-22.04"
os-folder: linux-64
- os-shell: bash -l {0}
- os: "windows-2022"
os-folder: win-64
os-shell: powershell
env-prefix: C:\c\
- os: "macos-14"
os-folder: osx-arm64
build-folder: .conda.tensorflow_macos
Expand All @@ -41,13 +44,19 @@ jobs:
if: env.RUN_BUILD_JOB == 'true'
uses: actions/checkout@v4

- name: Make conda prefix directory (Windows)
if: matrix.os == "windows-2022"
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path ${{ matrix.env-prefix }}
- name: Setup Miniconda
if: env.RUN_BUILD_JOB == 'true'
uses: conda-incubator/[email protected]
with:
python-version: "3.10"
environment-file: environment.tensorflow.yml
activate-environment: tf
activate-environment: ${{ matrix.env-prefix }}tf

- name: Print environment info
if: env.RUN_BUILD_JOB == 'true'
Expand All @@ -57,25 +66,19 @@ jobs:
conda info
conda list
- name: Build conda package (${{ matrix.os }})
if: (runner.os == 'Windows') && (env.RUN_BUILD_JOB == 'true')
shell: powershell
run: |
conda build --debug ${{ matrix.build-folder }} --output-folder build.tensorflow -c conda-forge
- name: Build conda package (${{ matrix.os }})
if: (runner.os != 'Windows') && (env.RUN_BUILD_JOB == 'true')
shell: bash -l {0}
- name: Build conda package
if: env.RUN_BUILD_JOB == 'true'
shell: matrix.os-shell
run: |
conda build --debug ${{ matrix.build-folder }} --output-folder build.tensorflow -c conda-forge
conda build --debug ${{ matrix.build-folder }} --output-folder ${{ matrix.env-prefix }}build.tensorflow -c conda-forge
# Upload the build artifact incase anaconda upload fails
- name: Upload conda package artifact
if: env.RUN_BUILD_JOB == 'true'
uses: actions/upload-artifact@v4
with:
name: tensorflow-build-${{ matrix.os-folder }}
path: build.tensorflow # Upload entire build directory
path: ${{ matrix.env-prefix }}build.tensorflow # Upload entire build directory
retention-days: 1

upload:
Expand Down

0 comments on commit 39b4275

Please sign in to comment.