-
Notifications
You must be signed in to change notification settings - Fork 5
130 lines (129 loc) · 4.9 KB
/
pack-nsis.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
---
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