Skip to content

Commit

Permalink
Add NSIS windows packaging
Browse files Browse the repository at this point in the history
- Add and readapt the NSIS scripts
  - All bundled executables are now passed as parameters within the
    makensis call
- Add a workflow that build the NSIS packages in the GH CI
  • Loading branch information
folmos-at-orange committed Oct 30, 2023
1 parent 26b99f6 commit 8b942d6
Show file tree
Hide file tree
Showing 19 changed files with 1,548 additions and 179 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Build development containers
name: Build Linux containers for packaging
on:
workflow_dispatch:
jobs:
build-container:
build-packaging-container:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -24,13 +24,11 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the image and push it to the registry
id: docker-build
uses: docker/build-push-action@v2
with:
# relative path to the place where source code with Dockerfile is located
context: ./packaging/dockerfiles
file: ./packaging/dockerfiles/Dockerfile.${{ matrix.os }}
# Note: tags must be lower-case
file: ./packaging/dockerfiles/linux/Dockerfile.${{ matrix.os }}
tags: ghcr.io/khiopsml/khiops/khiopsdev-${{ matrix.os }}:latest
push: true
- name: Display the image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker-build.outputs.digest }}
130 changes: 130 additions & 0 deletions .github/workflows/pack-nsis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
name: Build NSIS Windows installer
on:
workflow_dispatch:
pull_request:
paths:
- '**CMakeLists.txt'
- packaging/windows/nsis/*.nsh
- packaging/windows/nsis/*.nsi
jobs:
build-nsis-installer:
outputs:
khiops-package-version: ${{ steps.get-version.outputs.khiops-package-version }}
name: Build NSIS Windows installer
runs-on: windows-latest
steps:
- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 2
- name: Put the package version on the environment and output
id: get-version
shell: bash
run: |
# Obtain the ref name and type
if [[ "${{ github.ref }}" =~ ^refs/pull ]]
then
ref_name="$(git rev-parse --short HEAD~1)"
is_tag="false"
elif [[ "${{ github.ref }}" =~ ^refs/heads ]]
then
ref_name="${{ github.ref_name }}"
is_tag="false"
elif [[ "${{ github.ref }}" =~ ^refs/tags ]]
then
ref_name="${{ github.ref_name }}"
is_tag="true"
else
echo "::error Unsupported ref ${{ github.ref }}"
false
fi
# Build the versions
KHIOPS_PACKAGE_VERSION="$(./scripts/khiops-package-version $ref_name $is_tag)"
KHIOPS_PACKAGE_REDUCED_VERSION="$(echo $KHIOPS_PACKAGE_VERSION | cut -d'-' -f1)"
echo "KHIOPS_PACKAGE_VERSION=$KHIOPS_PACKAGE_VERSION" >> "$GITHUB_ENV"
echo "KHIOPS_PACKAGE_REDUCED_VERSION=$KHIOPS_PACKAGE_REDUCED_VERSION" >> "$GITHUB_ENV"
echo "khiops-package-version=$KHIOPS_PACKAGE_VERSION" >> "$GITHUB_OUTPUT"
- name: Download Windows install assets
uses: robinraju/[email protected]
with:
repository: khiopsml/khiops-win-install-assets
latest: true
- name: Extract Windows installer assets and load assets-info.env
shell: bash
run: |
assets_tar_gz=$(ls khiops-win-install-assets*.tar.gz)
tar -zxvf "$assets_tar_gz"
cat assets/assets-info.env >> "$GITHUB_ENV"
- name: Build Khiops binaries
uses: ./.github/actions/build-khiops
with:
preset-name: windows-msvc-release
targets: MODL MODL_Coclustering norm_jar khiops_jar
override-flags: -DTESTING=OFF -DBUILD_JARS=ON
- name: Build NSIS package
shell: pwsh
run: |-
cd ./packaging/windows/nsis
makensis `
/DKHIOPS_VERSION=${{ env.KHIOPS_PACKAGE_VERSION }} `
/DKHIOPS_REDUCED_VERSION=${{ env.KHIOPS_PACKAGE_REDUCED_VERSION }} `
/DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release `
/DJRE_INSTALLER_PATH=..\..\..\assets\${{ env.JRE_FILENAME }} `
/DJRE_VERSION=${{ env.JRE_VERSION }} `
/DMSMPI_INSTALLER_PATH=..\..\..\assets\${{ env.MSMPI_FILENAME }} `
/DMSMPI_VERSION=${{ env.MSMPI_VERSION }} `
/DKHIOPS_VIZ_INSTALLER_PATH=..\..\..\assets\${{ env.KHIOPS_VIZ_FILENAME }} `
/DKHIOPS_COVIZ_INSTALLER_PATH=..\..\..\assets\${{ env.KHIOPS_COVIZ_FILENAME }} `
/DKHIOPS_SAMPLES_DIR=..\..\..\assets\samples `
/DKHIOPS_DOC_DIR=..\..\..\assets\doc `
khiops.nsi
- name: Upload installer as an artifact
uses: actions/[email protected]
with:
name: khiops-installer
path: ./packaging/windows/nsis/khiops-${{ env.KHIOPS_PACKAGE_VERSION }}-setup.exe
test-nsis-installer:
name: Test NSIS Windows installer
needs: build-nsis-installer
runs-on: windows-2019
steps:
- name: Download NSIS installer artifact
uses: actions/[email protected]
with:
name: khiops-installer
- name: Install Khiops
shell: pwsh
run: |
# Execute the installer
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
Start-Process `
-FilePath .\khiops-${{ needs.build-nsis-installer.outputs.khiops-package-version }}-setup.exe `
-ArgumentList '/S' `
-Wait
# Add Khiops and MPI to the path
$Env:Path += ";${Env:ProgramFiles}\khiops\bin;${Env:ProgramFiles}\Microsoft MPI\Bin"
echo "PATH=${Env:PATH}" >> ${Env:GITHUB_ENV}
echo ${Env:GITHUB_ENV}
type ${Env:GITHUB_ENV}
- name: DDD
shell: bash
run: |
echo $PATH | sed 's/:/\n/g'
which khiops || true
which khiops.cmd || true
- name: DDD
if: success() || failure()
shell: pwsh
run: |
echo "$Env:PATH"
ls "${Env:ProgramFiles}\khiops\bin"
Get-Command khiops
- name: Checkout the khiops sources
# DDD
if: success() || failure()
uses: actions/checkout@v3
- name: Test the installation
uses: ./.github/actions/test-khiops-install
Binary file added packaging/common/images/khiops.ico
Binary file not shown.
Binary file added packaging/common/images/khiops_coclustering.ico
Binary file not shown.
23 changes: 6 additions & 17 deletions packaging/common/khiops/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ Upward compatibility with Khiops 9

Technical prerequisite
----------------------
Configuration:
Configuration:
PC Windows (Seven and higher), 64 bits
Linux (supported distributions: see www.khiops.com), 64 bits
Windows software:

Windows software:
Java Runtime Environment V7 or higher, Adobe AIR runtime V30.0, MS MPI 9
Automatic detection and silent installation during the Khiops installation process on Windows
For specific installation (other than default installation), ask "get Java" or
Expand All @@ -94,30 +94,19 @@ Root directory:
install.txt: installation process
KhiopsLicense.pdf: license file
Short-cuts to Khiops components

bin directory:
executable, batch files and libraries

doc directory:
reference guides and tutorial for Khiops components
start with KhiopsTutorial.pdf

python directory:
python library for Khiops (pykhiops) and samples of use of this library
see python/readme.txt

samples directory:
directory tree with database samples (database file (.txt) and dictionary file (.kdic))
see samples/readme.txt

key directory:
to store Khiops and Khiops Coclustering license files

lastrun directory:
contains scenario and log files for last run of Khiops and Khiops Coclustering



Khiops files on Linux
---------------------

Expand All @@ -137,4 +126,4 @@ Khiops files on Linux
to store Khiops and Khiops Coclustering license files

/tmp/khiops/$USER:
contains scenario and log files for last run of Khiops and Khiops Coclustering
contains scenario and log files for last run of Khiops and Khiops Coclustering
95 changes: 0 additions & 95 deletions packaging/common/khiops/install.txt

This file was deleted.

Loading

0 comments on commit 8b942d6

Please sign in to comment.