Build conda package #62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build conda package | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Version to package | |
required: true | |
build: | |
description: "Build revision of package (default: 0)" | |
required: false | |
default: '0' | |
jobs: | |
build_package_linux-64: | |
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 .github/recipe/meta.yaml /tmp/recipe/meta.yaml | |
cp .github/recipe/build.sh /tmp/recipe/build.sh | |
version=${{ github.event.inputs.version }} | |
build=${{ github.event.inputs.build }} | |
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 | |
sed -i "s/BUILD_PLACEHOLDER/${build}/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_osx-64: | |
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 coreutils | |
generate-run-shell: true | |
condarc: | | |
channels: | |
- dnachun | |
- conda-forge | |
- bioconda | |
- name: Create recipe from template | |
shell: micromamba-shell {0} | |
run: | | |
mkdir /tmp/recipe | |
cp .github/recipe/meta.yaml /tmp/recipe/meta.yaml | |
cp .github/recipe/build.sh /tmp/recipe/build.sh | |
version=${{ github.event.inputs.version }} | |
build=${{ github.event.inputs.build }} | |
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 | |
sed -i "s/BUILD_PLACEHOLDER/${build}/g" /tmp/recipe/meta.yaml | |
- 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 | |
build_package_osx-arm64: | |
name: Build conda package for osx-arm64 | |
runs-on: macos-14 | |
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 coreutils | |
generate-run-shell: true | |
condarc: | | |
channels: | |
- dnachun | |
- conda-forge | |
- bioconda | |
- name: Create recipe from template | |
shell: micromamba-shell {0} | |
run: | | |
mkdir /tmp/recipe | |
cp .github/recipe/meta.yaml /tmp/recipe/meta.yaml | |
cp .github/recipe/build.sh /tmp/recipe/build.sh | |
version=${{ github.event.inputs.version }} | |
build=${{ github.event.inputs.build }} | |
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 | |
sed -i "s/BUILD_PLACEHOLDER/${build}/g" /tmp/recipe/meta.yaml | |
- 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-arm64/*.tar.bz2 |