Skip to content

Commit

Permalink
Merge pull request #20 from cumc/update_recipe
Browse files Browse the repository at this point in the history
overhaul conda workflow
  • Loading branch information
danielnachun authored Dec 10, 2023
2 parents 51c53f8 + c94d998 commit 021bdad
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 132 deletions.
50 changes: 0 additions & 50 deletions .github/workflows/anaconda_upload.yml

This file was deleted.

107 changes: 107 additions & 0 deletions .github/workflows/conda_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Build conda package

on:
workflow_dispatch:
inputs:
version:
description: Version to build package for
required: true

jobs:
build_package_linux:
name: Build conda package for linux-64
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}

steps:
- name: Checkout pull request branch
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create recipe from template
run: |
mkdir /tmp/recipe
cp recipe/meta.yaml /tmp/recipe/meta.yaml
cp recipe/build.sh /tmp/recipe/build.sh
version=${{ github.event.inputs.version }}
wget https://github.com/cumc/pecotmr/archive/${version}.tar.gz
sha256sum=$(sha256sum ${version}.tar.gz | cut -d ' ' -f 1)
sed -i "s/VERSION_PLACEHOLDER/${version}/g" /tmp/recipe/meta.yaml
sed -i "s/SHA256SUM_PLACEHOLDER/${sha256sum}/g" /tmp/recipe/meta.yaml
- name: Setup up docker buildx
uses: docker/setup-buildx-action@v2

- name: Build and export docker containers
uses: docker/build-push-action@v4
with:
load: true
file: .github/mambaforge_container.df
tags: conda_mambabuild:latest

- name: Build conda packages
run: docker run --rm --volume /tmp:/tmp --volume $(pwd) --workdir $(pwd) conda_mambabuild conda mambabuild --output-folder /tmp/conda-bld /tmp/recipe

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: anaconda-client
create-args: anaconda-client
generate-run-shell: true

- name: Upload packages
shell: micromamba-shell {0}
run: anaconda upload --force /tmp/conda-bld/linux-64/*.tar.bz2

build_package_macos:
name: Build conda package for osx-64
runs-on: macos-latest
strategy:
fail-fast: false
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}

steps:
- name: Checkout pull request branch
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: boa
create-args: boa conda-verify anaconda-client sed
generate-run-shell: true

- name: Create recipe from template
shell: micromamba-shell {0}
run: |
mkdir /tmp/recipe
cp recipe/meta.yaml /tmp/recipe/meta.yaml
cp recipe/build.sh /tmp/recipe/build.sh
version=${{ github.event.inputs.version }}
wget https://github.com/cumc/pecotmr/archive/${version}.tar.gz
sha256sum=$(sha256sum ${version}.tar.gz | cut -d ' ' -f 1)
sed -i "s/VERSION_PLACEHOLDER/${version}/g" /tmp/recipe/meta.yaml
sed -i "s/SHA256SUM_PLACEHOLDER/${sha256sum}/g" /tmp/recipe/meta.yaml
- name: Set up channels
shell: micromamba-shell {0}
run: |
conda config --file /Users/runner/micromamba-bin/.condarc --append channels bioconda
conda config --file /Users/runner/micromamba-bin/.condarc --append channels nodefaults
xargs -I % conda config --file /Users/runner/micromamba-bin/.condarc --prepend channels % < .custom_channels
conda config --show-sources
- name: Build conda package
shell: micromamba-shell {0}
run: conda mambabuild --output-folder /tmp/conda-bld /tmp/recipe

- name: Upload package
shell: micromamba-shell {0}
run: anaconda upload --force /tmp/conda-bld/osx-64/*.tar.bz2
38 changes: 0 additions & 38 deletions .github/workflows/conda_mambabuild_linux-64.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/conda_mambabuild_osx-64.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ github.events.input.tag }}
commit_sha: ${{ github.events.input.commit }}
tag_prefix: ""

- name: Create a GitHub release
uses: ncipollo/release-action@v1
Expand Down
6 changes: 6 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

export DISABLE_AUTOBREW=1

# shellcheck disable=SC2086
${R} CMD INSTALL --build . ${R_ARGS}
93 changes: 93 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{% set version = "VERSION_PLACEHOLDER" %}
{% set name = "pecotmr" %}

package:
name: r-{{ name }}
version: {{ version }}

source:
url: https://github.com/cumc/{{ name }}/archive/{{ version }}.tar.gz
sha256: SHA256SUM_PLACEHOLDER

build:
merge_build_host: true # [win]
number: 0
rpaths:
- lib/R/lib/
- lib/

requirements:
build:
- cross-r-base {{ r_base }} # [build_platform != target_platform]
host:
- bioconductor-qvalue
- r-bedtoolsr
- r-base=4.2
- r-coloc
- r-data.table
- r-domc
- r-dplyr
- r-gbj
- r-ggplot2
- r-ggnewscale
- r-ggrepel
- r-ggvenn
- r-glmnet
- r-harmonicmeanp
- r-magrittr
- r-matrix
- r-mr.ash.alpha
- r-mr.mash.alpha
- r-pgenlibr
- r-plink2r
- r-purrr
- r-rcpp
- r-readr
- r-rfast
- r-rlab
- r-stringr
- r-susier
- r-vctrs
run:
- bioconductor-qvalue
- r-bedtoolsr
- r-base=4.2
- r-coloc
- r-data.table
- r-domc
- r-dplyr
- r-gbj
- r-ggplot2
- r-ggnewscale
- r-ggrepel
- r-ggvenn
- r-glmnet
- r-harmonicmeanp
- r-magrittr
- r-matrix
- r-mr.ash.alpha
- r-mr.mash.alpha
- r-pgenlibr
- r-plink2r
- r-purrr
- r-rcpp
- r-readr
- r-rfast
- r-rlab
- r-stringr
- r-susier
- r-vctrs

test:
commands:
- $R -e "library('{{ name }}')"

about:
home: https://github.com/stephenslab/mvsusier
license: GPL-3.0-or-later
license_file: LICENSE.md
summary: pecotmr implements pair-wise enrichment, colocalization, TWAS and Mendelian Randomization to integrate QTL and GWAS analysis based on a fine-mapped single effects model.

extra:
recipe-maintainers:
- danielnachun

0 comments on commit 021bdad

Please sign in to comment.