-
Notifications
You must be signed in to change notification settings - Fork 114
152 lines (133 loc) · 3.77 KB
/
build-plus.yml
File metadata and controls
152 lines (133 loc) · 3.77 KB
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Build Plus
on:
workflow_call:
inputs:
arch:
required: true
type: string
default: x64
os:
required: true
type: string
# Dependency versions
qt-version:
required: false
type: string
default: '5.15.0'
vtk-cache-key:
required: true
type: string
itk-cache-key:
required: true
type: string
# Plus cache
plus-cache-key:
required: false
type: string
# Plus build options
plus-config:
required: true
type: string
# Uploaded archive name
archive-name:
required: false
type: string
default: PlusInstaller
# Repos/tags for PlusLib and PlusApp
pluslib-repository:
required: false
type: string
default: https://github.com/PlusToolkit/PlusLib.git
pluslib-tag:
required: false
type: string
default: master
plusapp-repository:
required: false
type: string
default: https://github.com/Sunderlandkyl/PlusApp.git
plusapp-tag:
required: false
type: string
default: install_branch_temp
use-pltools:
required: false
type: boolean
default: false
secrets:
pltools-access-token:
required: false
jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- name: Restore VTK Cache
uses: actions/cache/restore@v4
with:
path: vtk-install
key: ${{ inputs.vtk-cache-key }}
- name: Restore ITK Cache
uses: actions/cache/restore@v4
with:
path: itk-install
key: ${{ inputs.itk-cache-key }}
- name: Plus Cache
if: ${{ inputs.plus-cache-key != '' }}
id: cache-plus
uses: actions/cache@v4
with:
path: build
key: ${{ inputs.plus-cache-key }}
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
dir: ${{ github.workspace }}/Qt
version: ${{ inputs.qt-version }}
arch: ${{ inputs.arch == 'x64' && 'win64_msvc2019_64' || 'win32_msvc2019' }}
- name: Clone PlusBuild
uses: actions/checkout@v4
with:
repository: PlusToolkit/PlusBuild
ref: master
path: PlusBuild
- name: Clone PLTools
if: ${{ inputs.use-pltools }}
uses: actions/checkout@v4
with:
repository: PerkLab/PLTools
ref: master
path: PLTools
token: ${{ secrets.pltools-access-token }}
- name: Configure PlusBuild
run: |
cmake -S PlusBuild -B build `
-G "Visual Studio 17 2022" -A ${{ inputs.arch }} `
-DCMAKE_BUILD_TYPE=Release `
-DPLUSLIB_GIT_REPOSITORY=${{ inputs.pluslib-repository }} `
-DPLUSLIB_GIT_REVISION=${{ inputs.pluslib-tag }} `
-DPLUSAPP_GIT_REPOSITORY=${{ inputs.plusapp-repository }} `
-DPLUSAPP_GIT_REVISION=${{ inputs.plusapp-tag }} `
-DQt5_Dir="${QT_DIR}" `
${{ inputs.plus-config }}
- name: Build
working-directory: ${{github.workspace}}/build
run: |
ctest -C Release -D Experimental -V
- uses: ilammy/msvc-dev-cmd@v1
- name: Package
if: contains(runner.os, 'windows')
working-directory: ${{github.workspace}}/build/PlusApp-bin
run: |
./CreatePackage.bat
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.archive-name }}
path: ${{github.workspace}}/build/PlusApp-bin/*.exe
# Delete the installer so that it isn't included in the cache.
- name: Delete installer
shell: bash
run: |
rm -rfv build/PlusApp-bin/*.exe
rm -rfv build/PlusApp-bin/*.zip
rm -rfv build/PlusApp-bin/_CPack_Packages