Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update continuous integration to use rattler-build #43

Merged
merged 5 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 29 additions & 31 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-variant: miniforge3
miniforge-version: latest
use-mamba: true
environment-file: envs/linux.yml
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Setup environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-variant: miniforge3
miniforge-version: latest
use-mamba: true
environment-file: envs/osx.yml
Expand All @@ -82,46 +82,44 @@ jobs:
# pytest

Deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- Test_Linux
- Test_Mac
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target-platform: linux-64
- os: macos-latest
target-platform: osx-arm64
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
python-version: 3.12
channels: conda-forge,bioconda,smcolby
use-only-tar-bz2: false
auto-activate-base: true

- name: Install dependencies
run: |
mamba install boa anaconda-client conda-verify conda-build


- name: Build conda package
run: |
mkdir build/
conda mambabuild conda-recipe/ --output-folder build/
conda index build/

- name: Convert to osx-arm64
run: conda convert -p osx-arm64 build/linux-64/*.tar.bz2 -o build/

- name: Upload packages
uses: prefix-dev/rattler-build-action@v0.2.24
with:
# Needs to be unique for each matrix entry
artifact-name: isicle-${{ matrix.target-platform }}
build-args: |
--target-platform ${{ matrix.target-platform }}
--recipe rattler-recipe/recipe.yaml
--variant-config rattler-recipe/variants.yaml
--output-dir build/
-c conda-forge
-c bioconda

- name: Upload conda package
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
anaconda upload build/linux-64/*.tar.bz2
anaconda upload build/osx-arm64/*.tar.bz2
for pkg in $(find build/ -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do
echo "Uploading ${pkg}"
rattler-build upload anaconda --owner smcolby "${pkg}"
done
6 changes: 0 additions & 6 deletions conda-recipe/conda_build_config.yaml

This file was deleted.

13 changes: 5 additions & 8 deletions conda-recipe/meta.yaml → rattler-recipe/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% set data = load_setup_py_data(setup_file="../setup.py",
from_recipe_dir=True) %}
context:
version: "2.0.0" # TODO: obtain this from package directly

package:
name: isicle
version: {{ data.get("version") }}
version: ${{ version }}

source:
path: ..
Expand All @@ -17,7 +17,8 @@ extra:

build:
number: 0
script: "{{ PYTHON }} -m pip install -vv --no-deps ."
script:
- python -m pip install -vv --no-deps .

requirements:
host:
Expand All @@ -37,7 +38,3 @@ requirements:
- snakemake >=6.3.0
- statsmodels >=0.11.1
- xtb >=6.5.1

test:
imports:
- isicle
6 changes: 6 additions & 0 deletions rattler-recipe/variants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
Loading