forked from Yubico/yubihsm-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
236 lines (201 loc) · 7.65 KB
/
release.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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: Release binaries
# This machine tests building the software on a both 32 and 64 Windows architecture.
on: [push]
jobs:
source:
name: Build dist with Linux
runs-on: ubuntu-latest
env:
VERSION: 2.4.0
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install prerequisites
run: |
set -x
sudo apt -q update
sudo apt install libpcsclite-dev gengetopt help2man libedit-dev libcurl4-openssl-dev libssl-dev libusb-1.0-0-dev
- name: Create tar.gz
run: |
set -x
./resources/make_src_dist.sh $VERSION
cd ..
mkdir artifact
mv $GITHUB_WORKSPACE/yubihsm-shell-$VERSION.tar.gz artifact/
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: yubihsm-shell-src
path: ../artifact
Windowsx86:
name: Build Windows x86 release
needs: source
runs-on: windows-latest
env:
VERSION: 2.4.0
steps:
- name: Download source from source job
uses: actions/download-artifact@v1
with:
name: yubihsm-shell-src
- name: Extract source
run: |
Set-PSDebug -Trace 1
cd yubihsm-shell-src
tar xf yubihsm-shell-$env:VERSION.tar.gz
- name: Build and make MSI installer
run: |
Set-PSDebug -Trace 1
$YHSHELL_SRC_DIR="$env:GITHUB_WORKSPACE\yubihsm-shell-src\yubihsm-shell-$env:VERSION"
$MERGEDPATH = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.*\MergeModules\Microsoft_VC141_CRT_x86.msm"
cd $YHSHELL_SRC_DIR/resources/release/win
./make_release_binaries.ps1 Win32 C:/vcpkg
cd $YHSHELL_SRC_DIR/resources/release/win
./repack_installer.ps1 x86 $env:WIX\bin "$MERGEDPATH"
mkdir $env:GITHUB_WORKSPACE/artifact
cp -r $YHSHELL_SRC_DIR/resources/release/win/yubihsm-shell-x86 $env:GITHUB_WORKSPACE/artifact/
cp -r $YHSHELL_SRC_DIR/resources/release/win/yubihsm-shell-x86.msi $env:GITHUB_WORKSPACE/artifact/
- name: Install yubihsm-shell
run: |
Set-PSDebug -Trace 1
cd "$env:GITHUB_WORKSPACE\yubihsm-shell-src\yubihsm-shell-$env:VERSION\resources\release\win"
msiexec /i yubihsm-shell-x86.msi /quiet /log $env:GITHUB_WORKSPACE/artifact/log_x86.txt
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: yubihsm-shell-win32
path: artifact
windowsx64:
name: Build Windows x64 release
needs: source
runs-on: windows-latest
env:
VERSION: 2.4.0
steps:
- name: Download source from source job
uses: actions/download-artifact@v1
with:
name: yubihsm-shell-src
- name: Extract source
run: |
Set-PSDebug -Trace 1
cd yubihsm-shell-src
tar xf yubihsm-shell-$env:VERSION.tar.gz
- name: Build and make MSI installer
run: |
Set-PSDebug -Trace 1
$YHSHELL_SRC_DIR="$env:GITHUB_WORKSPACE\yubihsm-shell-src\yubihsm-shell-$env:VERSION"
$MERGEDPATH = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.*\MergeModules\Microsoft_VC141_CRT_x86.msm"
cd $YHSHELL_SRC_DIR/resources/release/win
./make_release_binaries.ps1 x64 C:/vcpkg
cd $YHSHELL_SRC_DIR/resources/release/win
./repack_installer.ps1 x64 $env:WIX\bin "$MERGEDPATH"
mkdir $env:GITHUB_WORKSPACE/artifact
cp -r $YHSHELL_SRC_DIR/resources/release/win/yubihsm-shell-x64 $env:GITHUB_WORKSPACE/artifact/
cp -r $YHSHELL_SRC_DIR/resources/release/win/yubihsm-shell-x64.msi $env:GITHUB_WORKSPACE/artifact/
- name: Install yubihsm-shell
run: |
Set-PSDebug -Trace 1
cd "$env:GITHUB_WORKSPACE\yubihsm-shell-src\yubihsm-shell-$env:VERSION\resources\release\win"
msiexec /i yubihsm-shell-x64.msi /quiet /log $env:GITHUB_WORKSPACE/artifact/log_x64.txt
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: yubihsm-shell-win64
path: artifact
macos_amd64:
name: Build MacOS amd64 release
needs: source
runs-on: macos-latest
env:
VERSION: 2.4.0
SO_VERSION: 2
steps:
- name: Download source from source job
uses: actions/download-artifact@v1
with:
name: yubihsm-shell-src
- name: Extract source
run: |
set -x
cd yubihsm-shell-src
tar xf yubihsm-shell-$VERSION.tar.gz
- name: Build and make MSI installer
run: |
set -e -o pipefail
set -x
brew install [email protected]
ls /usr/local/opt
ls /usr/local/opt/[email protected]
ls /usr/local/opt/[email protected]/lib
YHSHELL_SRC_DIR="$GITHUB_WORKSPACE/yubihsm-shell-src/yubihsm-shell-$VERSION"
cd $YHSHELL_SRC_DIR
./resources/release/macos/make_release_binaries.sh amd $VERSION $SO_VERSION
cd $YHSHELL_SRC_DIR/resources/release/macos/
./make_installer.sh amd64 $YHSHELL_SRC_DIR/resources/release/macos/yubihsm-shell-darwin-amd-$VERSION
mkdir $GITHUB_WORKSPACE/artifact
cp -r $YHSHELL_SRC_DIR/resources/release/macos/yubihsm-shell-darwin-amd-$VERSION $GITHUB_WORKSPACE/artifact/
cp -r $YHSHELL_SRC_DIR/resources/release/macos/yubihsm2-sdk-darwin-amd64.pkg $GITHUB_WORKSPACE/artifact/
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: yubihsm-shell-darwin-amd64
path: artifact
ubuntu2204:
name: Build Ubuntu 22.04 release
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install prerequisites
run: |
set -x
sudo apt -q update
sudo apt install libpcsclite-dev gengetopt help2man libedit-dev libcurl4-openssl-dev libssl-dev libusb-1.0-0-dev debhelper dh-exec cmake chrpath
- name: Build release package
run: |
set -e -o pipefail
set -x
mkdir $GITHUB_WORKSPACE/artifact
dpkg-buildpackage -b --no-sign
cp ../*.deb $GITHUB_WORKSPACE/artifact/
LICENSE_DIR="$GITHUB_WORKSPACE/artifact/share/yubihsm-shell"
mkdir -p $LICENSE_DIR
cp -r resources/release/linux/licenses $LICENSE_DIR/
for lf in $LICENSE_DIR/licenses/*; do
chmod 644 $lf
done
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: yubihsm-shell-ubuntu2204-amd64
path: artifact
ubuntu2004:
name: Build Ubuntu 20.04 release
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install prerequisites
run: |
set -x
sudo apt -q update
sudo apt install libpcsclite-dev gengetopt help2man libedit-dev libcurl4-openssl-dev libssl-dev libusb-1.0-0-dev debhelper dh-exec cmake
- name: Build release package
run: |
set -e -o pipefail
set -x
mkdir $GITHUB_WORKSPACE/artifact
dpkg-buildpackage -b --no-sign
cp ../*.deb $GITHUB_WORKSPACE/artifact/
LICENSE_DIR="$GITHUB_WORKSPACE/artifact/share/yubihsm-shell"
mkdir -p $LICENSE_DIR
cp -r resources/release/linux/licenses $LICENSE_DIR/
for lf in $LICENSE_DIR/licenses/*; do
chmod 644 $lf
done
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: yubihsm-shell-ubuntu2004-amd64
path: artifact