Skip to content

Commit

Permalink
Simplify conda build
Browse files Browse the repository at this point in the history
The conda version doesn't contain dashes. We handle this directly in the conda.yml with a search and replace.
Rather than doing it upstream, befor calling conda build. It simplifies both local and CI builds.
  • Loading branch information
bruno-at-orange committed Oct 18, 2024
1 parent bb88a6e commit 919beac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,13 @@ jobs:
shell: bash
run: |
# Put the Khiops package version
# The conda version cannot have '-' as a character so we eliminate it
if [[ "${{ github.ref_type }}" == "tag" ]]
then
KHIOPS_RAW_VERSION="${{ github.ref_name }}"
KHIOPS_VERSION="${{ github.ref_name }}"
else
KHIOPS_RAW_VERSION="$(./scripts/khiops-version)"
KHIOPS_VERSION="$(./scripts/khiops-version)"
fi
echo "KHIOPS_VERSION=$(echo $KHIOPS_RAW_VERSION | sed 's/-//')" >> "$GITHUB_ENV"
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
Expand Down
4 changes: 1 addition & 3 deletions packaging/conda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ You'll need `conda-build` installed in your system.
# These commands will leave a ready to use conda channel in `./khiops-conda`

# khiops version must be set before launching the build (can be retrieved with the script scripts/khiops-version).
# The dash must be removed from the version to be compliant with the conda versionning policy
export KHIOPS_RAW_VERSION=$(scripts/khiops-version)
export KHIOPS_VERSION=$(echo $KHIOPS_RAW_VERSION | sed 's/-//')
export KHIOPS_VERSION=$(scripts/khiops-version)

conda build --output-folder ./khiops-conda packaging/conda
```
Expand Down
12 changes: 7 additions & 5 deletions packaging/conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% set version = os.environ.get('KHIOPS_VERSION') %}

package:
name: khiops-binaries
version: {{ os.environ.get('KHIOPS_VERSION') }}
version: {{ version.replace("-", ".") }}

source:
path: ../../
Expand Down Expand Up @@ -40,7 +42,7 @@ outputs:

# khiops-core package
- name: khiops-core
version: {{ os.environ.get('KHIOPS_VERSION') }}
version: {{ version.replace("-", ".") }}
requirements:
build:
- cmake
Expand All @@ -61,13 +63,13 @@ outputs:
- bin/khiops_coclustering.cmd # [win]
test:
commands:
- khiops_env --env
- khiops_env --env
- khiops -s
- khiops_coclustering -s

# kni package (do not need khiops-core as a runtime dependency)
- name: kni
version: {{ os.environ.get('KHIOPS_VERSION') }}
version: {{ version.replace("-", ".") }}
files:
- lib/libKhiopsNativeInterface.so* # [linux]
- lib/libKhiopsNativeInterface*.dylib # [osx]
Expand All @@ -81,7 +83,7 @@ outputs:

# kni-transfer package (designed only to test kni)
- name: kni-transfer
version: {{ os.environ.get('KHIOPS_VERSION') }}
version: {{ version.replace("-", ".") }}
requirements:
build:
- cmake
Expand Down

0 comments on commit 919beac

Please sign in to comment.