11---
2- name : Conda
2+ name : Conda Packages
33env :
4- DEFAULT_KHIOPS_REVISION : dev
4+ DEFAULT_KHIOPS_REVISION : main
55 DEFAULT_SAMPLES_REVISION : main
66on :
77 workflow_dispatch :
88 inputs :
99 khiops-revision :
10- default : dev
10+ default : main
1111 description : khiops repo revision
1212 samples-revision :
1313 default : main
1414 description : khiops-samples repo revision
1515 push :
1616 tags : [v*]
1717 pull_request :
18- paths : [.github/workflows/build-conda-package.yml]
18+ paths :
19+ - packaging/conda/**
20+ - ' !packaging/conda/README.md'
21+ - .github/workflows/build-conda-package.yml
1922defaults :
2023 run :
2124 shell : bash -el {0}
2225concurrency :
2326 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2427 cancel-in-progress : true
2528jobs :
26- build-packages :
27- name : Build Packages
29+ build :
2830 strategy :
2931 fail-fast : false
3032 matrix :
3133 # Use the oldest supported Mac OS and Ubuntu versions for GLIBC compatibility
32- os : [ubuntu-20.04, windows-latest, macos-11]
34+ include :
35+ - os : ubuntu-20.04
36+ os-family : linux
37+ - os : windows-latest
38+ os-family : windows
39+ - os : macos-11
40+ os-family : macos
3341 runs-on : ${{ matrix.os }}
3442 outputs :
3543 pkg-version : ${{ steps.get-pkg-version.outputs.pkg-version }}
3644 steps :
3745 - name : Checkout Sources
38- uses : actions/checkout@v3
46+ uses : actions/checkout@v4
3947 with :
4048 # Checkout the full repository to have the tags so versioneer works properly
4149 # See issue https://github.com/actions/checkout/issues/701
5159 - name : Install Miniconda
5260 uses : conda-incubator/setup-miniconda@v3
5361 with :
54- activate-environment : khiops-python-env
62+ miniconda-version : latest
63+ python-version : ' 3.11'
5564 - name : Install Dependency Requirements for Building Conda Packages
5665 run : conda install conda-build=3.27.0 conda-verify
5766 # We need MacOS SDK 10.10 to build on Big Sur
@@ -81,27 +90,27 @@ jobs:
8190 )
8291 echo "pkg-version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
8392 - name : Upload Khiops Conda Package
84- uses : actions/upload-artifact@v3
93+ uses : actions/upload-artifact@v4
8594 with :
86- name : khiops-${{ steps.get-pkg-version.outputs.pkg-version }}-conda
95+ name : khiops-conda- ${{ matrix.os-family }}
8796 path : ./khiops-conda
8897 retention-days : 7
8998 # Test Conda package on brand new environments
90- test-packages :
91- needs : build-packages
99+ test :
100+ needs : build
92101 strategy :
93102 fail-fast : false
94103 matrix :
95- os :
96- - ubuntu-20.04
97- - ubuntu-22.04
98- - windows-2019
99- - windows-2022
100- - macos-11
101- - macos-12
102- - macos-13
103- python-version : ['3.8', '3.9', '3.10', '3.11']
104- runs-on : ${{ matrix.os }}
104+ env :
105+ - {os: ubuntu-20.04, os-family: linux}
106+ - {os: ubuntu-22.04, os-family: linux}
107+ - {os: windows-2019, os-family: windows}
108+ - {os: windows-2022, os-family: windows}
109+ - {os: macos-11, os-family: macos}
110+ - {os: macos-12, os-family: macos}
111+ - {os: macos-13, os-family: macos}
112+ python-version : ['3.8', '3.9', '3.10', '3.11', '3.12' ]
113+ runs-on : ${{ matrix.env. os }}
105114 env :
106115 KHIOPS_SAMPLES_DIR : ./khiops-samples-repo
107116 steps :
@@ -114,7 +123,7 @@ jobs:
114123 if : github.event_name == 'workflow_dispatch'
115124 run : echo "SAMPLES_REVISION=${{ inputs.samples-revision }}" >> "$GITHUB_ENV"
116125 - name : Checkout Khiops samples
117- uses : actions/checkout@v3
126+ uses : actions/checkout@v4
118127 with :
119128 repository : khiopsml/khiops-samples
120129 ref : ${{ env.SAMPLES_REVISION }}
@@ -123,13 +132,12 @@ jobs:
123132 - name : Install Miniconda
124133 uses : conda-incubator/setup-miniconda@v3
125134 with :
126- miniconda-version : latest # needed for Mac OS 13
135+ miniconda-version : latest # needed for macOS 13
127136 python-version : ${{ matrix.python-version }}
128- activate-environment : khiops-python-env
129137 - name : Download Conda Package Artifact
130- uses : actions/download-artifact@v3
138+ uses : actions/download-artifact@v4
131139 with :
132- name : khiops-${{ needs.build-packages.outputs.pkg-version }}-conda
140+ name : khiops-conda- ${{ matrix.env.os-family }}
133141 path : khiops-conda
134142 - name : Install the Khiops Conda pagkage (Windows)
135143 if : runner.os == 'Windows'
@@ -147,17 +155,48 @@ jobs:
147155 kh-samples core -i train_coclustering -e
148156 kh-samples sklearn -i khiops_classifier -e
149157 kh-samples sklearn -i khiops_coclustering -e
150- # Build and push Conda package release archive
151- release-packages :
152- # We need `build-packages` because we use its output
153- needs : [build-packages, test-packages]
158+ # Release is only executed on tags
159+ release :
160+ if : github.ref_type == 'tag'
161+ # We need `build` because we use its output
162+ needs : [build, test]
154163 runs-on : ubuntu-latest
155164 permissions :
156165 contents : write
157- packages : read
158166 steps :
167+ - name : Download package artifacts
168+ uses : actions/download-artifact@v4
169+ with :
170+ # See the upload-artifact step in the build job for the explanation of this pattern
171+ path : ./khiops-conda
172+ pattern : khiops-conda-*
173+ merge-multiple : true
174+ - name : Install Miniconda
175+ uses : conda-incubator/setup-miniconda@v3
176+ with :
177+ miniconda-version : latest
178+ python-version : ' 3.11'
179+ - name : Reindex the package
180+ run : |
181+ conda install -y conda-build=3.27.0
182+ conda-index ./khiops-conda
183+ - name : Create the release zip archive
184+ uses : thedoctor0/zip-release@0.7.6
185+ with :
186+ type : zip
187+ path : ./khiops-conda/
188+ filename : khiops-${{ needs.build.outputs.pkg-version }}-conda.zip
189+ - name : Upload conda package artifacts for all platforms
190+ uses : actions/upload-artifact@v4
191+ with :
192+ name : khiops-conda-all
193+ path : ./khiops-${{ needs.build.outputs.pkg-version }}-conda.zip
159194 - name : Release the zip archive
160- if : github.event_name == 'push'
161195 uses : ncipollo/release-action@v1
162196 with :
163- artifacts : khiops-${{ needs.build-packages.outputs.pkg-version }}-conda
197+ allowUpdates : true
198+ artifacts : ./khiops-${{ needs.build.outputs.pkg-version }}-conda.zip
199+ draft : false
200+ makeLatest : false
201+ prerelease : true
202+ updateOnlyUnreleased : true
0 commit comments