Skip to content

Commit 74bada8

Browse files
eberriganroomrys
andauthored
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 <[email protected]> * Update .github/workflows/build.yml Co-authored-by: Liezl Maree <[email protected]> * 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 <[email protected]>
1 parent 6a0cf9c commit 74bada8

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,41 @@ jobs:
1818
include:
1919
# Use this condarc as default
2020
- condarc: .conda/condarc.yaml
21+
- pyver: "3.7"
2122
# Use special condarc if macos
2223
- os: "macos-14"
2324
condarc: .conda_mac/condarc.yaml
25+
pyver: "3.9"
2426
steps:
2527
# Setup
2628
- uses: actions/checkout@v2
2729
- name: Cache conda
2830
uses: actions/cache@v1
2931
env:
3032
# Increase this value to reset cache if environment_build.yml has not changed
31-
CACHE_NUMBER: 0
33+
CACHE_NUMBER: 1
3234
with:
3335
path: ~/conda_pkgs_dir
3436
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'requirements.txt') }}
37+
3538
- name: Setup Miniconda
36-
# https://github.com/conda-incubator/setup-miniconda
37-
uses: conda-incubator/[email protected]
39+
uses: conda-incubator/[email protected]
3840
with:
39-
python-version: 3.7
40-
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
41-
environment-file: environment_build.yml
41+
miniforge-version: latest
4242
condarc-file: ${{ matrix.condarc }}
43+
python-version: ${{ matrix.pyver }}
44+
environment-file: environment_build.yml
4345
activate-environment: sleap_ci
46+
conda-solver: "libmamba"
47+
# Increase the cache number if build dependencies change! Otherwise, the cache will not be invalidated.
48+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
49+
4450
- name: Print environment info
4551
shell: bash -l {0}
4652
run: |
4753
which python
4854
conda info
55+
conda list
4956
5057
# Build pip wheel (Ubuntu)
5158
- name: Build pip wheel (Ubuntu)
@@ -69,20 +76,23 @@ jobs:
6976
shell: bash -l {0}
7077
run: |
7178
conda build .conda --output-folder build
79+
echo "BUILD_PATH=$(pwd)/build" >> "$GITHUB_ENV"
7280
73-
# Build conda package (Windows)
81+
# Build conda package (Windows)
7482
- name: Build conda package (Windows)
7583
if: matrix.os == 'windows-2022'
7684
shell: powershell
7785
run: |
7886
conda build .conda --output-folder build
87+
echo "BUILD_PATH=\$(pwd)\build" >> "$env:GITHUB_ENV"
7988
8089
# Build conda package (Mac)
8190
- name: Build conda package (Mac)
8291
if: matrix.os == 'macos-14'
8392
shell: bash -l {0}
8493
run: |
8594
conda build .conda_mac --output-folder build
95+
echo "BUILD_PATH=$(pwd)/build" >> "$GITHUB_ENV"
8696
8797
# Test built conda package (Ubuntu and Windows)
8898
- name: Test built conda package (Ubuntu and Windows)
@@ -91,7 +101,7 @@ jobs:
91101
run: |
92102
echo "Current build path: $BUILD_PATH"
93103
conda deactivate
94-
104+
95105
echo "Python executable before activating environment:"
96106
which python
97107
echo "Python version before activating environment:"
@@ -113,7 +123,7 @@ jobs:
113123
conda list
114124
echo "List of installed pip packages in the sleap_test environment:"
115125
pip list
116-
126+
117127
echo "Testing sleap package installation..."
118128
sleap_version=$(python -c "import sleap; print(sleap.__version__)")
119129
echo "Test completed using sleap version: $sleap_version"
@@ -125,18 +135,18 @@ jobs:
125135
run: |
126136
echo "Current build path: $BUILD_PATH"
127137
conda deactivate
128-
138+
129139
echo "Python executable before activating environment:"
130140
which python
131141
echo "Python version before activating environment:"
132142
python --version
133143
echo "Conda info before activating environment:"
134144
conda info
135-
145+
136146
echo "Creating and testing conda environment with sleap package..."
137147
conda create -y -n sleap_test -c file://$BUILD_PATH -c conda-forge -c anaconda sleap
138148
conda activate sleap_test
139-
149+
140150
echo "Python executable after activating sleap_test environment:"
141151
which python
142152
echo "Python version after activating sleap_test environment:"
@@ -147,7 +157,7 @@ jobs:
147157
conda list
148158
echo "List of installed pip packages in the sleap_test environment:"
149159
pip list
150-
160+
151161
echo "Testing sleap package installation..."
152162
sleap_version=$(python -c "import sleap; print(sleap.__version__)")
153163
echo "Test completed using sleap version: $sleap_version"

sleap/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"""
1313

1414

15-
__version__ = "1.4.0a0"
15+
__version__ = "1.4.1a0"
1616

1717

1818
def versions():

0 commit comments

Comments
 (0)