-
Notifications
You must be signed in to change notification settings - Fork 5
207 lines (205 loc) · 8.21 KB
/
conda.yml
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
---
name: Conda Packages
on:
workflow_dispatch:
inputs:
release-channel:
type: choice
default: khiops-dev
options: [khiops-dev, khiops]
description: Anaconda channel to release
push:
tags: ['*']
pull_request:
paths:
- packaging/conda/**
- '!packaging/conda/README.md'
- .github/workflows/conda.yml
defaults:
run:
shell: bash -el {0}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
}}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
setup:
# Linux: We use the Khiops dev debian:10 container to build with glibc 2.28
# It ensures compatibility with glibc >= 2.28 (in particular Rocky 8)
- {os: ubuntu-22.04, os-family: linux-64, json-image: '{"image": "ghcr.io/khiopsml/khiops/khiopsdev-debian10:latest"}'}
- {os: windows-2022, os-family: win-64, json-image: '{"image": null}'}
- {os: macos-13, os-family: osx-64, json-image: '{"image": null}'}
- {os: macos-14, os-family: osx-arm64, json-image: '{"image": null}'}
container: ${{ fromJSON(matrix.setup.json-image) }}
runs-on: ${{ matrix.setup.os }}
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Check the tag consistency with the source version
if: github.ref_type == 'tag'
uses: ./.github/actions/check-tag-version
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: '3.12'
conda-remove-defaults: true
- name: Install Dependency Requirements for Building Conda Packages
run: conda install -y conda-build
# We need MacOS SDK 10.10 to build for macOS Intel
# See: https://docs.conda.io/projects/conda-build/en/3.21.x/resources/compiler-tools.html#macos-sdk
- name: Install Mac OS SDK 10.10
if: runner.os == 'macOS'
run: |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz
sudo tar -zxvf MacOSX10.10.sdk.tar.xz -C /opt
- name: Set the environment variables
shell: bash
run: |
# Put the Khiops package version
if [[ "${{ github.ref_type }}" == "tag" ]]
then
KHIOPS_VERSION="${{ github.ref_name }}"
else
KHIOPS_VERSION="$(./scripts/khiops-version)"
fi
echo "KHIOPS_VERSION=$KHIOPS_VERSION" >> "$GITHUB_ENV"
# On tag and macOS: Set the environment variables to sign the binaries
if [[ "${{ runner.os }}" == "macOS" && "${{ github.ref_type }}" == "tag" ]]
then
echo "KHIOPS_APPLE_CERTIFICATE_COMMON_NAME=${{ secrets.KHIOPS_APPLE_CERTIFICATE_COMMON_NAME }}" >> "$GITHUB_ENV"
echo "KHIOPS_APPLE_CERTIFICATE_BASE64=${{ secrets.KHIOPS_APPLE_CERTIFICATE_BASE64 }}" >> "$GITHUB_ENV"
echo "KHIOPS_APPLE_CERTIFICATE_PASSWORD=${{ secrets.KHIOPS_APPLE_CERTIFICATE_PASSWORD }}" >> "$GITHUB_ENV"
echo "KHIOPS_APPLE_TMP_KEYCHAIN_PASSWORD=${{ secrets.KHIOPS_APPLE_TMP_KEYCHAIN_PASSWORD }}" >> "$GITHUB_ENV"
fi
- name: Build conda packages
run: |
conda build --output-folder ./build/conda ./packaging/conda
- name: Upload conda packages artifact
uses: actions/upload-artifact@v4
with:
name: khiops-conda-${{ matrix.setup.os-family }}
path: ./build/conda
retention-days: 7
# Test Conda package on brand new environments
test:
needs: build
strategy:
fail-fast: false
matrix:
env:
- {os: ubuntu-20.04, os-family: linux-64}
- {os: ubuntu-22.04, os-family: linux-64}
- {os: ubuntu-24.04, os-family: linux-64}
- {os: windows-2019, os-family: win-64}
- {os: windows-2022, os-family: win-64}
- {os: macos-12, os-family: osx-64}
- {os: macos-13, os-family: osx-64}
- {os: macos-14, os-family: osx-arm64}
runs-on: ${{ matrix.env.os }}
steps:
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest # needed for macOS 13
python-version: ${{ matrix.python-version }}
conda-remove-defaults: true
- name: Download Conda Package Artifact
uses: actions/download-artifact@v4
with:
name: khiops-conda-${{ matrix.env.os-family }}
path: ./build/conda
- name: Install the Conda package
run: |
conda install --channel ./build/conda khiops-core
- name: Install the Khiops executables in the Conda environment
run: |
conda install --channel conda-forge --channel ./build/conda khiops-core
- name: Add CONDA_PREFIX to shared PATH
run: |
echo "$CONDA_PREFIX/bin" >> $GITHUB_PATH
- name: Checkout sources
uses: actions/checkout@v4
- name: Test that the Khiops executables are installed
uses: ./.github/actions/test-khiops-install
- name: Test the Khiops executables on the Iris dataset
uses: ./.github/actions/test-khiops-on-iris
with:
os-decription: ${{ matrix.env.os }}-${{ matrix.env.os-family }}
# Release is only executed on tags
# Note: For this job to work the secrets variables KHIOPS_ANACONDA_CHANNEL_TOKEN and
# KHIOPS_DEV_ANACONDA_CHANNEL_TOKEN must be set with valid anaconda.org access tokens
release:
if: github.ref_type == 'tag'
needs: test
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Download package artifacts
uses: actions/download-artifact@v4
with:
# See the upload-artifact step in the build job for the explanation of this pattern
path: ./build/conda
pattern: khiops-conda-*
merge-multiple: true
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: '3.12'
conda-remove-defaults: true
- name: Install requirement packages
run: |
conda install -y anaconda-client conda-index
- name: Reindex the package directory
run: python -m conda_index ./build/conda
- name: Upload the packages to anaconda.org
run: |
# Set the anaconda.org channel
ANACONDA_CHANNEL="${{ inputs.release-channel || 'khiops-dev' }}"
# For the release channel: upload without forcing; do not upload kni-transfer
if [[ "$ANACONDA_CHANNEL" == "khiops" ]]
then
rm -f -v ./build/conda/*/kni-transfer*.tar.bz2
anaconda --token "${{ secrets.KHIOPS_ANACONDA_CHANNEL_TOKEN }}" upload \
--user "$ANACONDA_CHANNEL" ./build/conda/*/*.tar.bz2
# For the dev channel: upload with forcing
else
anaconda --token "${{ secrets.KHIOPS_DEV_ANACONDA_CHANNEL_TOKEN }}" upload \
--user "$ANACONDA_CHANNEL" --force ./build/conda/*/*.tar.bz2
fi
- name: Extract package version
run: |
PKG_VERSION=$(\
conda search --override-channels --channel ./build/conda/ khiops-core \
| awk '!/#|channels/ {print $2}' \
| sort -u \
)
echo "PKG_VERSION=$PKG_VERSION" >> "$GITHUB_ENV"
- name: Create the release zip archive
uses: thedoctor0/[email protected]
with:
type: zip
path: ./build/conda
filename: khiops-${{ env.PKG_VERSION }}-conda.zip
- name: Upload conda package artifacts for all platforms
uses: actions/upload-artifact@v4
with:
name: khiops-conda-all
path: ./khiops-${{ env.PKG_VERSION }}-conda.zip
- name: Release the zip archive
uses: ncipollo/release-action@v1
with:
allowUpdates: true
body: |
**This release is for testing purposes only and there is no support for it.**
**Go to https://khiops.org to install the latest supported version.**
draft: false
makeLatest: false
prerelease: true
updateOnlyUnreleased: true