Skip to content

Build conda package #117

Build conda package

Build conda package #117

Workflow file for this run

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
matrix:
variant: ["r43", "r44"]
env:
ANACONDA_API_KEY: ${{ secrets.ANACONDA_API_TOKEN }}
ANACONDA_OWNER: ${{ vars.ANACONDA_OWNER }}
steps:
- name: Checkout pull request branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
run-install: false
- name: Create recipe from template
shell: pixi exec --spec sed --spec coreutils --spec wget -- bash -e {0}
run: |
mkdir /tmp/recipe
cp .github/recipe/recipe.yaml /tmp/recipe/recipe.yaml
cp .github/recipe/variant_${{ matrix.variant}}.yaml /tmp/recipe/variants.yaml
version=${{ github.event.inputs.version }}
build=${{ github.event.inputs.build }}
wget https://github.com/StatFunGen/pecotmr/archive/${version}.tar.gz
sha256sum=$(sha256sum ${version}.tar.gz | cut -d ' ' -f 1)
sed -i "s/VERSION_PLACEHOLDER/${version}/g" /tmp/recipe/recipe.yaml
sed -i "s/SHA256SUM_PLACEHOLDER/${sha256sum}/g" /tmp/recipe/recipe.yaml
sed -i "s/BUILD_PLACEHOLDER/${build}/g" /tmp/recipe/recipe.yaml
- name: Setup up docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and export docker containers
uses: docker/build-push-action@v6
with:
load: true
file: .github/rattler-build_container.df
tags: rattler-build:latest
- name: Build conda packages
run: |
docker run --rm --volume /tmp:/tmp \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--volume $(pwd) --workdir $(pwd) \
--user $(id -u) rattler-build \
rattler-build build -c dnachun -c conda-forge -c bioconda \
--output-dir /tmp/rattler-build --recipe-dir /tmp/recipe
- name: Upload package
shell: pixi exec --spec rattler-build -- bash -e {0}
run: rattler-build upload anaconda --force /tmp/rattler-build/linux-64/*.conda
build_package_osx-64:
name: Build conda package for osx-64
runs-on: macos-13
strategy:
fail-fast: false
matrix:
variant: ["r43", "r44"]
env:
ANACONDA_API_KEY: ${{ secrets.ANACONDA_API_TOKEN }}
ANACONDA_OWNER: ${{ vars.ANACONDA_OWNER }}
steps:
- name: Checkout pull request branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
run-install: false
- name: Create recipe from template
shell: pixi exec --spec sed --spec coreutils --spec wget -- bash -e {0}
run: |
mkdir /tmp/recipe
cp .github/recipe/recipe.yaml /tmp/recipe/recipe.yaml
cp .github/recipe/variant_${{ matrix.variant}}.yaml /tmp/recipe/variants.yaml
version=${{ github.event.inputs.version }}
build=${{ github.event.inputs.build }}
wget https://github.com/StatFunGen/pecotmr/archive/${version}.tar.gz
sha256sum=$(sha256sum ${version}.tar.gz | cut -d ' ' -f 1)
sed -i "s/VERSION_PLACEHOLDER/${version}/g" /tmp/recipe/recipe.yaml
sed -i "s/SHA256SUM_PLACEHOLDER/${sha256sum}/g" /tmp/recipe/recipe.yaml
sed -i "s/BUILD_PLACEHOLDER/${build}/g" /tmp/recipe/recipe.yaml
- name: Build conda package
shell: pixi exec --spec rattler-build -- bash -e {0}
run: rattler-build build -c dnachun -c conda-forge -c bioconda --output-dir /tmp/rattler-build --recipe-dir /tmp/recipe
- name: Upload package
shell: pixi exec --spec rattler-build -- bash -e {0}
run: rattler-build upload anaconda --force /tmp/rattler-build/osx-64/*.conda
build_package_osx-arm64:
name: Build conda package for osx-arm64
runs-on: macos-14
strategy:
fail-fast: false
matrix:
variant: ["r43", "r44"]
env:
ANACONDA_API_KEY: ${{ secrets.ANACONDA_API_TOKEN }}
ANACONDA_OWNER: ${{ vars.ANACONDA_OWNER }}
steps:
- name: Checkout pull request branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pixi
uses: prefix-dev/[email protected]
with:
run-install: false
- name: Create recipe from template
shell: pixi exec --spec sed --spec coreutils --spec wget -- bash -e {0}
run: |
mkdir /tmp/recipe
cp .github/recipe/recipe.yaml /tmp/recipe/recipe.yaml
cp .github/recipe/variant_${{ matrix.variant}}.yaml /tmp/recipe/variants.yaml
version=${{ github.event.inputs.version }}
build=${{ github.event.inputs.build }}
wget https://github.com/StatFunGen/pecotmr/archive/${version}.tar.gz
sha256sum=$(sha256sum ${version}.tar.gz | cut -d ' ' -f 1)
sed -i "s/VERSION_PLACEHOLDER/${version}/g" /tmp/recipe/recipe.yaml
sed -i "s/SHA256SUM_PLACEHOLDER/${sha256sum}/g" /tmp/recipe/recipe.yaml
sed -i "s/BUILD_PLACEHOLDER/${build}/g" /tmp/recipe/recipe.yaml
- name: Build conda package
shell: pixi exec --spec rattler-build -- bash -e {0}
run: rattler-build build -c dnachun -c conda-forge -c bioconda --output-dir /tmp/rattler-build --recipe-dir /tmp/recipe
- name: Upload package
shell: pixi exec --spec rattler-build -- bash -e {0}
run: rattler-build upload anaconda --force /tmp/rattler-build/osx-arm64/*.conda