Conda Build #106
Workflow file for this run
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: Conda Build | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
buildNumber: | |
type: string | |
required: false | |
default: "0" | |
description: "build-nr: conda build-nr of anaconda.org" | |
version: | |
type: string | |
required: true | |
description: "version: PEP440 package-version (incl. leading 'v')" | |
dev: | |
required: true | |
type: boolean | |
description: "dev-build? If yes, it sets an offset to build-nr" | |
workflow_call: | |
inputs: | |
buildNumber: | |
type: string | |
required: true | |
version: | |
type: string | |
required: true | |
dev: | |
required: false | |
default: false | |
type: boolean | |
jobs: | |
conda-build: | |
runs-on: ubuntu-latest | |
container: ghcr.io/i4ds/mambabuild-docker:latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get Previous tag | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: get-latest-tag | |
- name: Build Conda | |
shell: bash -l {0} | |
run: | | |
if [[ ${{ github.event_name }} == "release" ]] | |
then | |
BUILD_NR="0" | |
KARABO_TAG=${{ steps.get-latest-tag.outputs.tag }} | |
KARABO_VER="${KARABO_TAG:1}" | |
fi | |
if [[ ${{ github.event_name }} == "workflow_dispatch" ]] || [[ ${{ github.event_name }} == "workflow_call" ]] | |
then | |
BUILD_NR=${{ inputs.buildNumber }} | |
KARABO_VER=${{ inputs.version }} | |
fi | |
DEV_STR="dev" | |
if [[ ${{ inputs.dev }} == "true" ]] | |
then | |
if [[ "$KARABO_VER" != *"$DEV_STR"* ]] | |
then | |
exit 2 | |
fi | |
BUILD_NR="$(($BUILD_NR + 999))" | |
else | |
if [[ "$KARABO_VER" == *"$DEV_STR"* ]] | |
then | |
exit 2 | |
fi | |
fi | |
export KARABO_VERSION=$KARABO_VER | |
export BUILD_NUMBER=$BUILD_NR | |
conda config --append channels i4ds | |
conda config --append channels nvidia/label/cuda-11.7.0 | |
conda config --append channels conda-forge | |
cd conda | |
conda mambabuild . | |
- name: Publish to Conda | |
shell: bash -l {0} | |
run: | | |
conda activate base | |
anaconda -t ${{ secrets.ANACONDA_SECRET }} upload /opt/conda/conda-bld/linux-64/karabo-pipeline-*.tar.bz2 --force |