-
Notifications
You must be signed in to change notification settings - Fork 8
109 lines (102 loc) · 3.3 KB
/
conda-build.yml
File metadata and controls
109 lines (102 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Conda Build
on:
workflow_dispatch:
inputs:
buildNumber:
type: string
required: true
description: "build-nr: anaconda.org build-nr (DON'T trigger build if you don't know how to set it)"
version:
type: string
required: true
description: "version: PEP440 package-version (DON'T trigger build if you don't know what PEP440 is)"
python-version:
type: string
required: true
description: "Python version to test"
buildDocker:
type: boolean
required: false
default: false
description: "build docker-img if conda-build & tests succeeded?"
latestDocker:
type: boolean
required: false
default: false
description: "tag docker-img as latest (if `buildDocker` is enabled)"
workflow_call:
inputs:
buildNumber:
type: string
required: true
version:
type: string
required: true
python-version:
type: string
required: true
description: "Python version to test"
buildDocker:
type: boolean
required: false
default: false
latestDocker:
type: boolean
required: false
default: false
secrets:
ANACONDA_SECRET:
required: true
jobs:
conda-build:
runs-on: ubuntu-latest
outputs:
karabo-version: ${{ steps.bcs.outputs.karabo_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
- name: Build Conda
id: bcs
shell: bash -l {0}
run: |
build=${{ inputs.buildNumber }}
LATEST_DOCKER=${{ inputs.latestDocker }}
KARABO_VERSION=${{ inputs.version }}
if [[ ${KARABO_VERSION:0:1} == "v" ]]; then
KARABO_VERSION="${KARABO_VERSION:1}"
fi
if [[ "$KARABO_VERSION" == *"dev"* ]]; then
if [[ $LATEST_DOCKER == 'true' ]]; then
echo "Dev build docker image can not be tagged as latest!"
exit 1
fi
build="$(($build + 1000))"
fi
conda install -y -n base conda-libmamba-solver
conda config --set solver libmamba
conda install anaconda-client "conda-build>=25"
conda config --remove channels defaults
conda config --append channels i4ds
conda config --append channels nvidia/label/cuda-11.7.0
conda config --append channels conda-forge
export KARABO_VERSION=$KARABO_VERSION build=$build
conda build conda
echo "karabo_version=$KARABO_VERSION" >> $GITHUB_OUTPUT
- name: Publish to Conda
shell: bash -l {0}
run: |
which anaconda
anaconda --help
anaconda -t ${{ secrets.ANACONDA_SECRET }} upload /usr/share/miniconda/envs/test/conda-bld/linux-64/karabo-pipeline-*.conda --force
test-conda-wheel:
needs: conda-build
uses: ./.github/workflows/test-conda-wheel.yml
with:
version: ${{ needs.conda-build.outputs.karabo-version }}
buildDocker: ${{ inputs.buildDocker }}
latestDocker: ${{ inputs.latestDocker }}
python-version: ${{ inputs.python-version }}