From 74bada85475ff8d7867995a17e9abc17bc305656 Mon Sep 17 00:00:00 2001 From: Elizabeth <106755962+eberrigan@users.noreply.github.com> Date: Tue, 28 May 2024 09:31:15 -0700 Subject: [PATCH] Upgrade build actions for release (#1779) * update `build.yml` so it matches updates from `build_manual.yml` * test `build.yml` without uploading * test again using build_manual.yml * build pip wheel with Ubuntu and turn off caching so build.yml exactly matches build_manual.yml * `build.yml` on release only and upload * testing caching * `use-only-tar-bz2: true` makes environment unsolvable, change it back * Update .github/workflows/build_manual.yml Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * Update .github/workflows/build.yml Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> * bump pre-release version * fix version for pre-release * run build and upload on release! * try setting `CACHE_NUMBER` to 1 with `use-only-tar-bz2` set to true * increasing the cache number to reset the cache does work when `use-only-tar-bz2` is set to true * publish and upload on release only --------- Co-authored-by: Liezl Maree <38435167+roomrys@users.noreply.github.com> --- .github/workflows/build.yml | 36 +++++++++++++++++++++++------------- sleap/version.py | 2 +- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e427cfdea..00c6321b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,9 +18,11 @@ jobs: include: # Use this condarc as default - condarc: .conda/condarc.yaml + - pyver: "3.7" # Use special condarc if macos - os: "macos-14" condarc: .conda_mac/condarc.yaml + pyver: "3.9" steps: # Setup - uses: actions/checkout@v2 @@ -28,24 +30,29 @@ jobs: uses: actions/cache@v1 env: # Increase this value to reset cache if environment_build.yml has not changed - CACHE_NUMBER: 0 + CACHE_NUMBER: 1 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'requirements.txt') }} + - name: Setup Miniconda - # https://github.com/conda-incubator/setup-miniconda - uses: conda-incubator/setup-miniconda@v2.0.1 + uses: conda-incubator/setup-miniconda@v3.0.3 with: - python-version: 3.7 - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - environment-file: environment_build.yml + miniforge-version: latest condarc-file: ${{ matrix.condarc }} + python-version: ${{ matrix.pyver }} + environment-file: environment_build.yml activate-environment: sleap_ci + conda-solver: "libmamba" + # Increase the cache number if build dependencies change! Otherwise, the cache will not be invalidated. + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + - name: Print environment info shell: bash -l {0} run: | which python conda info + conda list # Build pip wheel (Ubuntu) - name: Build pip wheel (Ubuntu) @@ -69,13 +76,15 @@ jobs: shell: bash -l {0} run: | conda build .conda --output-folder build + echo "BUILD_PATH=$(pwd)/build" >> "$GITHUB_ENV" - # Build conda package (Windows) + # Build conda package (Windows) - name: Build conda package (Windows) if: matrix.os == 'windows-2022' shell: powershell run: | conda build .conda --output-folder build + echo "BUILD_PATH=\$(pwd)\build" >> "$env:GITHUB_ENV" # Build conda package (Mac) - name: Build conda package (Mac) @@ -83,6 +92,7 @@ jobs: shell: bash -l {0} run: | conda build .conda_mac --output-folder build + echo "BUILD_PATH=$(pwd)/build" >> "$GITHUB_ENV" # Test built conda package (Ubuntu and Windows) - name: Test built conda package (Ubuntu and Windows) @@ -91,7 +101,7 @@ jobs: run: | echo "Current build path: $BUILD_PATH" conda deactivate - + echo "Python executable before activating environment:" which python echo "Python version before activating environment:" @@ -113,7 +123,7 @@ jobs: conda list echo "List of installed pip packages in the sleap_test environment:" pip list - + echo "Testing sleap package installation..." sleap_version=$(python -c "import sleap; print(sleap.__version__)") echo "Test completed using sleap version: $sleap_version" @@ -125,18 +135,18 @@ jobs: run: | echo "Current build path: $BUILD_PATH" conda deactivate - + echo "Python executable before activating environment:" which python echo "Python version before activating environment:" python --version echo "Conda info before activating environment:" conda info - + echo "Creating and testing conda environment with sleap package..." conda create -y -n sleap_test -c file://$BUILD_PATH -c conda-forge -c anaconda sleap conda activate sleap_test - + echo "Python executable after activating sleap_test environment:" which python echo "Python version after activating sleap_test environment:" @@ -147,7 +157,7 @@ jobs: conda list echo "List of installed pip packages in the sleap_test environment:" pip list - + echo "Testing sleap package installation..." sleap_version=$(python -c "import sleap; print(sleap.__version__)") echo "Test completed using sleap version: $sleap_version" diff --git a/sleap/version.py b/sleap/version.py index 077594506..005006385 100644 --- a/sleap/version.py +++ b/sleap/version.py @@ -12,7 +12,7 @@ """ -__version__ = "1.4.0a0" +__version__ = "1.4.1a0" def versions():