-
Notifications
You must be signed in to change notification settings - Fork 310
Expand file tree
/
Copy pathbuild-clienttools-windows-2022.yml
More file actions
176 lines (159 loc) · 6.17 KB
/
build-clienttools-windows-2022.yml
File metadata and controls
176 lines (159 loc) · 6.17 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Build Clienttools windows-2022
env:
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,read"
VCPKG_NUGET_REPOSITORY: "https://nuget.pkg.github.com/hpcc-systems/index.json"
on:
workflow_call:
inputs:
upload-package:
type: boolean
description: 'Share asset for eclide build'
required: false
default: false
asset-name:
type: string
description: 'ECLIDE clienttools Asset name'
required: false
default: 'windows-2022-clienttools'
community-ref:
type: string
description: 'community_[semver]'
required: true
ln-ref:
type: string
description: 'internal_[semver]'
required: false
default: ''
cmake-config-options:
type: string
description: 'CMake config options'
required: false
default: '-T host=x64 -A x64 -DUSE_OPTIONAL=OFF -DCLIENTTOOLS_ONLY=ON -DUSE_AZURE=OFF -DUSE_CASSANDRA=OFF -DUSE_PARQUET=OFF -DUSE_JAVA=OFF -DUSE_OPENLDAP=OFF -DDIGICERT_KEYPAIR_ALIAS=RIS_Data_Services_HPCC_Systems'
cmake-build-options:
type: string
description: 'CMake build options'
required: false
default: '--config Release --parallel $NUMBER_OF_PROCESSORS'
make-latest:
type: boolean
description: 'Make Latest'
required: false
default: false
jobs:
generate_windows_2022_clienttools:
name: Generate Windows Clienttools
runs-on: "windows-2022"
steps:
- name: Checkout HPCC-Platform
uses: actions/checkout@v4
with:
ref: ${{ inputs.community-ref }}
submodules: recursive
path: ./HPCC-Platform
- name: Checkout LN
if: ${{ inputs.ln-ref != '' }}
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/LN
ref: ${{ inputs.ln-ref }}
token: ${{ secrets.LNB_TOKEN }}
submodules: recursive
path: ./LN
- name: Setup Certificate File
- name: Setup Certificate File
shell: "pwsh"
run: |
$base64 = "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
if ([string]::IsNullOrEmpty($base64)) {
Write-Error "Secret SM_CLIENT_CERT_FILE_B64 is empty or not set."
exit 1
}
$bytes = [Convert]::FromBase64String($base64)
$outDir = "$env:RUNNER_TEMP"
$p12Path = Join-Path $outDir "sm_client_cert.p12"
[IO.File]::WriteAllBytes($p12Path, $bytes)
# Make sure the path is visible to subsequent steps
"SM_CLIENT_CERT_FILE=$p12Path" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Setup Software Trust Manager
uses: digicert/code-signing-software-trust-action@v1.0.1
with:
simple-signing-mode: true
keypair-alias: "RIS_Data_Services_HPCC_Systems"
env:
SM_HOST: https://clientauth.one.digicert.com
SM_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
SM_CLIENT_CERT_FILE: ${{ env.SM_CLIENT_CERT_FILE }}
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
- name: vcpkg bootstrap
shell: "bash"
run: |
./HPCC-Platform/vcpkg/bootstrap-vcpkg.sh
- name: "Setup NuGet credentials"
shell: "bash"
run: |
`./HPCC-Platform/vcpkg/vcpkg fetch nuget | tail -n 1` \
sources add \
-name "GitHub" \
-source "https://nuget.pkg.github.com/hpcc-systems/index.json" \
-storepasswordincleartext \
-username "${{ github.repository_owner }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
- name: Setup Source Directory
id: setup_source
shell: "bash"
run: |
if [ -d ./LN ]; then
echo "LN directory exists; building internal clienttools"
echo "source_dir=./LN" >> $GITHUB_OUTPUT
else
echo "LN directory does not exist; building community clienttools"
echo "source_dir=./HPCC-Platform" >> $GITHUB_OUTPUT
fi
- name: Build Clienttools
id: build_clienttools
shell: "bash"
run: |
mkdir -p ./build
cmake -S ${{ steps.setup_source.outputs.source_dir }} -B ./build ${{ inputs.cmake-config-options }}
if [ -d ./LN ]; then
cmake --build ./build ${{ inputs.cmake-build-options }} --target LN_SIGN
else
cmake --build ./build ${{ inputs.cmake-build-options }} --target SIGN
fi
env:
SM_HOST: https://clientauth.one.digicert.com
SM_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
SM_CLIENT_CERT_FILE: ${{ env.SM_CLIENT_CERT_FILE }}
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
- name: Release Community Clienttools
if: ${{ inputs.ln-ref == '' }}
uses: ncipollo/release-action@v1.16.0
with:
allowUpdates: true
generateReleaseNotes: false
prerelease: ${{ contains(github.ref, '-rc') }}
makeLatest: ${{ inputs.make-latest }}
artifacts: "${{ steps.build_clienttools.outputs.packages }}"
- name: Release Internal Clienttools to JFrog Repository
if: ${{ inputs.ln-ref != '' && github.repository_owner == 'hpcc-systems' }}
shell: "bash"
run: |
cd ./build
packages=($(ls -1 hpccsystems-clienttools-internal*.exe ))
for _package in ${packages[@]}; do
curl -u${{ secrets.JFROG_USERNAME }}:${{ secrets.JFROG_PASSWORD }} "https://${{ secrets.JFROG_REGISTRY }}/hpccpl-windows-local/LN/windows/x86_64/${_package}" -T ${_package}
done
- name: Share Asset for ECLIDE build
if: ${{ inputs.upload-package }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.asset-name }}
path: ./build/hpccsystems-clienttools*.exe
compression-level: 0
- name: Upload Error Logs
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v4
with:
name: windows-2022-clienttools-logs-${{ github.job }}-${{ github.run_number }}
path: ./build/**/*.log
retention-days: 1