Skip to content

Update actions/checkout action to v7 #1574

Update actions/checkout action to v7

Update actions/checkout action to v7 #1574

Workflow file for this run

---
name: Windows Installer
on:
workflow_dispatch:
inputs:
signature-activation:
type: boolean
required: true
default: false
description: Sign installer and binaries
pull_request:
paths:
- '**CMakeLists.txt'
- '!test/**CMakeLists.txt'
- '!test/UniTests/**'
- '!test/LearningTestTool/**'
- '!test/MemoryStatsVisualizer/**'
- packaging/windows/nsis/*.nsh
- packaging/windows/nsis/*.nsi
- .github/workflows/pack-nsis.yml
push:
tags: ['*']
# Cancel any ongoing run of this workflow on the same PR or ref
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
}}
cancel-in-progress: true
# Environment variables:
# - SAMPLES_VERSION: tag of the sample repository packed in the installer
# - ASSETS_VERSION: tag of the khiops-win-install-assets repository packed in the installer
# - KEYPAIR is used by smctl
# - CERTIFICATE is used by jsign
env:
KEYPAIR: KP_Khiops_HSM
CERTIFICATE: Cert_Khiops
SAMPLES_VERSION: 11.0.0
ASSETS_VERSION: 11.0.1
NSIS_VERSION: 3.11
jobs:
build:
outputs:
khiops-version: ${{ steps.get-version.outputs.khiops-version }}
runs-on: windows-2025-vs2026
steps:
- name: Checkout sources
uses: actions/checkout@v7
- name: Check the tag consistency with the source version
if: github.ref_type == 'tag'
uses: ./.github/actions/check-tag-version
- name: Install NSIS
# Copy code from repolevedavaj/install-nsis
run: |
Invoke-WebRequest -UserAgent "Wget" https://sourceforge.net/projects/nsis/files/NSIS%203/$env:NSIS_VERSION/nsis-$env:NSIS_VERSION-setup.exe/download -OutFile C:\WINDOWS\Temp\nsis-$env:NSIS_VERSION-setup.exe
$process = Start-Process "C:\WINDOWS\Temp\nsis-$env:NSIS_VERSION-setup.exe" -ArgumentList "/S" -Wait -PassThru
$exitCode = $process.ExitCode
if ($exitCode -eq 0) {
Write-Host "Installer ran successfully."
} else {
Write-Host "Installer failed with exit code $exitCode."
exit $exitCode
}
echo "C:\Program Files (x86)\NSIS\Bin" | Out-File -FilePath "$env:GITHUB_PATH" -Append
echo "C:\Program Files (x86)\NSIS" | Out-File -FilePath "$env:GITHUB_PATH" -Append
shell: pwsh
- name: Ensure makensis is available
run: |
Get-Command makensis
makensis /VERSION
shell: pwsh
- name: Apply NSIS long string patch
run: |
Invoke-WebRequest -UserAgent "Wget" https://sourceforge.net/projects/nsis/files/NSIS%203/$env:NSIS_VERSION/nsis-$env:NSIS_VERSION-strlen_8192.zip/download -OutFile C:\WINDOWS\Temp\nsis-$env:NSIS_VERSION-strlen_8192.zip
Expand-Archive "C:\WINDOWS\Temp\nsis-$env:NSIS_VERSION-strlen_8192.zip" -DestinationPath "C:\Program Files (x86)\NSIS" -Force
shell: pwsh
- name: Install Java Temurin
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '21'
- name: Put the package version on the environment and output
id: get-version
shell: bash
run: |
# Build the versions
KHIOPS_VERSION="$(./scripts/khiops-version)"
KHIOPS_REDUCED_VERSION="$(echo $KHIOPS_VERSION | cut -d'-' -f1)"
echo "KHIOPS_VERSION=$KHIOPS_VERSION" >> "$GITHUB_ENV"
echo "KHIOPS_REDUCED_VERSION=$KHIOPS_REDUCED_VERSION" >> "$GITHUB_ENV"
echo "khiops-version=$KHIOPS_VERSION" >> "$GITHUB_OUTPUT"
- name: Download Windows installer assets and load assets-info.env
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download $ASSETS_VERSION --repo KhiopsML/khiops-win-install-assets --pattern '*.tar.gz'
assets_tar_gz=$(ls khiops-win-install-assets*.tar.gz)
echo "Extracting $assets_tar_gz"
tar -zxf "$assets_tar_gz"
cat assets/assets-info.env >> "$GITHUB_ENV"
rm "$assets_tar_gz"
# We download the latest version of khiops-visualization-desktop:
# - It is backward compatible.
# - The process is made easier by getting automatically the latest version
- name: Download latest releases of khiops-visualization-desktop
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh --repo https://github.com/KhiopsML/khiops-visualization-desktop release download --pattern *.exe -D visualization
cd visualization
echo "Downloaded files: $(ls *)"
echo "KHIOPS_VIZ_FILENAME=$(ls *)" >> "$GITHUB_ENV"
- name: Download samples
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh --repo https://github.com/KhiopsML/khiops-samples release download $SAMPLES_VERSION
unzip khiops-samples* -d samples
ls samples
- name: Build the Khiops Binaries
uses: ./.github/actions/build-khiops
with:
preset-name: windows-msvc-release
targets: MODL MODL_Coclustering norm_jar khiops_jar KhiopsNativeInterface
KNITransfer _khiopsgetprocnumber _khiopslauncher khisto
override-flags: -DTESTING=OFF -DBUILD_JARS=ON
- name: Setup SM_CLIENT_CERT_FILE from base64 secret data
if: ${{ inputs.signature-activation }}
run: |
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
shell: bash
- name: Setup Software Trust Manager and sign
uses: digicert/code-signing-software-trust-action@v1.2.1
if: ${{ inputs.signature-activation }}
with:
input: build/windows-msvc-release/bin/
keypair-alias: ${{ env.KEYPAIR }}
simple-signing-mode: true
env:
SM_HOST: ${{ secrets.SM_HOST }}
SM_API_KEY: ${{ secrets.SM_API_KEY }}
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
- name: Install jsign
if: ${{ inputs.signature-activation }}
run: |
curl -L https://github.com/ebourg/jsign/releases/download/7.4/jsign-7.4.jar --output jsign.jar --output-dir /d
shell: bash
- name: Build NSIS package (signature is ON)
if: ${{ inputs.signature-activation }}
shell: pwsh
run: |-
cd ./packaging/windows/nsis
makensis `
/DKHIOPS_VERSION=${{ env.KHIOPS_VERSION }} `
/DKHIOPS_REDUCED_VERSION=${{ env.KHIOPS_REDUCED_VERSION }} `
/DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release `
/DJRE_PATH=..\..\..\assets\jre `
/DMSMPI_INSTALLER_PATH=..\..\..\assets\${{ env.MSMPI_FILENAME }} `
/DMSMPI_VERSION=${{ env.MSMPI_VERSION }} `
/DKHIOPS_VIZ_INSTALLER_PATH=..\..\..\visualization\${{ env.KHIOPS_VIZ_FILENAME }} `
/DKHIOPS_SAMPLES_DIR=..\..\..\samples `
/DSIGN `
/DPATH_TO_JSIGN=D:\\jsign.jar `
/DSM_CERT_ALIAS=$Env:CERTIFICATE `
/DSM_CLIENT_CERT_FILE=${{ env.SM_CLIENT_CERT_FILE }} `
/DSM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }} `
/DSM_API_KEY=${{ secrets.SM_API_KEY }} `
khiops.nsi
- name: Build NSIS package (signature is OFF)
if: ${{ ! inputs.signature-activation }}
shell: pwsh
run: |-
cd ./packaging/windows/nsis
makensis `
/DKHIOPS_VERSION=${{ env.KHIOPS_VERSION }} `
/DKHIOPS_REDUCED_VERSION=${{ env.KHIOPS_REDUCED_VERSION }} `
/DKHIOPS_WINDOWS_BUILD_DIR=..\..\..\build\windows-msvc-release `
/DJRE_PATH=..\..\..\assets\jre `
/DMSMPI_INSTALLER_PATH=..\..\..\assets\${{ env.MSMPI_FILENAME }} `
/DMSMPI_VERSION=${{ env.MSMPI_VERSION }} `
/DKHIOPS_VIZ_INSTALLER_PATH=..\..\..\visualization\${{ env.KHIOPS_VIZ_FILENAME }} `
/DKHIOPS_SAMPLES_DIR=..\..\..\samples `
khiops.nsi
- name: Sign installer
uses: digicert/code-signing-software-trust-action@v1.2.1
if: ${{ inputs.signature-activation }}
with:
input: packaging/windows/nsis/khiops-${{ env.KHIOPS_VERSION }}-setup.exe
keypair-alias: ${{ env.KEYPAIR }}
simple-signing-mode: true
env:
SM_HOST: ${{ secrets.SM_HOST }}
SM_API_KEY: ${{ secrets.SM_API_KEY }}
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
- name: Build ZIP packages
shell: bash
run: |-
cd build/windows-msvc-release && CPACK -G ZIP
- name: Upload the Installer Artifact
uses: actions/upload-artifact@v7
with:
name: khiops-setup
path: ./packaging/windows/nsis/khiops-${{ env.KHIOPS_VERSION }}-setup.exe
- name: Upload the KNI zip
uses: actions/upload-artifact@v7
with:
name: KNI
path: |
./build/windows-msvc-release/packages/KNI-${{ env.KHIOPS_VERSION }}.zip
./build/windows-msvc-release/packages/kni-transfer-${{ env.KHIOPS_VERSION }}.zip
- name: Upload the Khisto zip
uses: actions/upload-artifact@v7
with:
name: khisto
path: ./build/windows-msvc-release/packages/khisto-${{ env.KHIOPS_VERSION }}.zip
- name: Upload the Khiops zip
uses: actions/upload-artifact@v7
with:
name: khiops
path: |
./build/windows-msvc-release/packages/khiops-${{ env.KHIOPS_VERSION }}.zip
./build/windows-msvc-release/packages/khiops-core-${{ env.KHIOPS_VERSION }}.zip
test-khiops:
needs: build
runs-on: windows-2025-vs2026
steps:
- name: Download NSIS installer artifact
uses: actions/download-artifact@v8
with:
name: khiops-setup
- name: Install Khiops
shell: pwsh
run: |
# Execute the installer
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
Start-Process `
-FilePath .\khiops-${{ needs.build.outputs.khiops-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: Checkout the khiops sources
uses: actions/checkout@v7
- name: Test the installation
uses: ./.github/actions/test-khiops-install
- name: Add Khiops binary path to the environment
shell: pwsh
run: |
$Env:BIN_DIR = "${Env:ProgramFiles}\khiops\bin"
echo "BIN_DIR=${Env:BIN_DIR}" >> ${Env:GITHUB_ENV}
- name: Run standard tests
uses: ./.github/actions/run-standard-tests
with:
warning_as_error: true
running-mode: parallel
config: release
binary-path: ${{ env.BIN_DIR }}
test-kni:
needs: build
runs-on: windows-2025-vs2026
steps:
- name: Checkout sources
uses: actions/checkout@v7
- name: Download KNI zip
uses: actions/download-artifact@v8
with:
name: KNI
- name: Install KNI
shell: bash
run: |
7z x KNI-${{ needs.build.outputs.khiops-version }}.zip -o${GITHUB_WORKSPACE}/KNI
- name: Test KNI zip
uses: ./.github/actions/test-kni
# Release is only executed on tags
release:
if: github.ref_type == 'tag'
needs: [build, test-khiops, test-kni]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download NSIS installer artifact
uses: actions/download-artifact@v8
with:
name: khiops-setup
- name: Download KNI installer artifact
uses: actions/download-artifact@v8
with:
name: KNI
- name: Download khiops zip installer artifact
uses: actions/download-artifact@v8
with:
name: khiops
- name: Download khisto zip installer artifact
uses: actions/download-artifact@v8
with:
name: khisto
- name: Rename packages with tag version
run: |
# Build the package file names
SOURCE_VERSION="${{ needs.build.outputs.khiops-version }}"
PKG_FILE=$(ls *-setup.exe)
NEW_PKG_FILE=$(echo $PKG_FILE | sed "s/-${SOURCE_VERSION}-/-${{ github.ref_name }}-/")
# Rename to the tag version only if it is not coherent with the source version
if [[ "$PKG_FILE" != "$NEW_PKG_FILE" ]]
then
mv $PKG_FILE $NEW_PKG_FILE
fi
- name: Upload packages to the release
uses: ncipollo/release-action@v1.21.0
with:
allowUpdates: true
artifacts: khiops-*-setup.exe,KNI-*.zip,kni-transfer-*.zip,khiops-*.zip,khisto-*.zip
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