-
Notifications
You must be signed in to change notification settings - Fork 99
145 lines (120 loc) · 5.16 KB
/
windows_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
name: Windows Release
# This machine tests building the software on a both 32 and 64 Windows architecture.
# The binaries used on the official release are also produced here and are downloadable as artifacts
# Since this is where the release binaries are build, make sure to update the 'RELEASE_VERSION' environment variable
# defined by all 3 jobs
on: [push]
jobs:
job_1:
name: Build dist with Linux
runs-on: ubuntu-latest
env:
RELEASE_VERSION: 2.7.0
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install prerequisites
run: |
set -x
sudo apt install libpcsclite-dev check gengetopt help2man zlib1g-dev
- name: Create tar.gz
run: |
set -x
./resources/make_src_dist.sh $RELEASE_VERSION
cd ..
mkdir $GITHUB_WORKSPACE/artifact
mv $GITHUB_WORKSPACE/yubico-piv-tool-$RELEASE_VERSION.tar.gz $GITHUB_WORKSPACE/artifact/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: yubico-piv-tool-src
path: artifact
job_2:
name: Build Windows x86
needs: job_1
runs-on: windows-latest
env:
RELEASE_VERSION: 2.7.0
steps:
- name: Download source from job_1
uses: actions/download-artifact@v4
with:
name: yubico-piv-tool-src
- name: Extract source
run: |
Set-PSDebug -Trace 1
tar xf yubico-piv-tool-$env:RELEASE_VERSION.tar.gz
- name: Make release binaries
run: |
Set-PSDebug -Trace 1
$PIVTOOL_SRC_DIR="$env:GITHUB_WORKSPACE\yubico-piv-tool-$env:RELEASE_VERSION"
cd $PIVTOOL_SRC_DIR/resources/win
./make_release_binaries.ps1 $env:RELEASE_VERSION Win32 C:/vcpkg
cd $PIVTOOL_SRC_DIR/yubico-piv-tool-$env:RELEASE_VERSION-x86/bin
./yubico-piv-tool.exe --version
./yubico-piv-tool.exe --help
mkdir $env:GITHUB_WORKSPACE/artifact
cp -r $PIVTOOL_SRC_DIR/yubico-piv-tool-$env:RELEASE_VERSION-x86 $env:GITHUB_WORKSPACE/artifact/
- name: Create Windows Installer
run: |
Set-PSDebug -Trace 1
$PIVTOOL_SRC_DIR="$env:GITHUB_WORKSPACE\yubico-piv-tool-$env:RELEASE_VERSION"
$MERGEDPATH = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\v143\MergeModules\Microsoft_VC143_CRT_x86.msm"
cd $PIVTOOL_SRC_DIR/resources/win
./make_installer.ps1 $PIVTOOL_SRC_DIR/yubico-piv-tool-$env:RELEASE_VERSION-x86 $env:RELEASE_VERSION x86 $env:WIX\bin "$MERGEDPATH"
cp $PIVTOOL_SRC_DIR/resources/win/yubico-piv-tool-$env:RELEASE_VERSION-x86.msi $env:GITHUB_WORKSPACE/artifact/
- name: Install yubico-piv-tool
run: |
Set-PSDebug -Trace 1
cd "$env:GITHUB_WORKSPACE\yubico-piv-tool-$env:RELEASE_VERSION\resources\win"
msiexec /i yubico-piv-tool-$env:RELEASE_VERSION-x86.msi /quiet /log $env:GITHUB_WORKSPACE/artifact/log_x86.txt
Start-Sleep -s 5
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: yubico-piv-tool-win32
path: artifact
job_3:
name: Build Windows x64
needs: job_1
runs-on: windows-latest
env:
RELEASE_VERSION: 2.7.0
steps:
- name: Download source from job_1
uses: actions/download-artifact@v4
with:
name: yubico-piv-tool-src
- name: Extract source
run: |
Set-PSDebug -Trace 1
tar xf yubico-piv-tool-$env:RELEASE_VERSION.tar.gz
- name: Make release binaries
run: |
Set-PSDebug -Trace 1
$PIVTOOL_SRC_DIR="$env:GITHUB_WORKSPACE\yubico-piv-tool-$env:RELEASE_VERSION"
cd $PIVTOOL_SRC_DIR/resources/win
./make_release_binaries.ps1 $env:RELEASE_VERSION x64 C:/vcpkg
cd $PIVTOOL_SRC_DIR/yubico-piv-tool-$env:RELEASE_VERSION-x64/bin
./yubico-piv-tool.exe --version
./yubico-piv-tool.exe --help
mkdir $env:GITHUB_WORKSPACE/artifact
cp -r $PIVTOOL_SRC_DIR/yubico-piv-tool-$env:RELEASE_VERSION-x64 $env:GITHUB_WORKSPACE/artifact/
- name: Create Windows Installer for x64 architecture
run: |
Set-PSDebug -Trace 1
$PIVTOOL_SRC_DIR="$env:GITHUB_WORKSPACE\yubico-piv-tool-$env:RELEASE_VERSION"
$MERGEDPATH = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\v143\MergeModules\Microsoft_VC143_CRT_x64.msm"
cd $PIVTOOL_SRC_DIR/resources/win
./make_installer.ps1 $PIVTOOL_SRC_DIR/yubico-piv-tool-$env:RELEASE_VERSION-x64 $env:RELEASE_VERSION x64 $env:WIX\bin "$MERGEDPATH"
cp $PIVTOOL_SRC_DIR/resources/win/yubico-piv-tool-$env:RELEASE_VERSION-x64.msi $env:GITHUB_WORKSPACE/artifact/
- name: Install yubico-piv-tool
run: |
Set-PSDebug -Trace 1
cd "$env:GITHUB_WORKSPACE\yubico-piv-tool-$env:RELEASE_VERSION\resources\win"
msiexec /i yubico-piv-tool-$env:RELEASE_VERSION-x64.msi /quiet
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: yubico-piv-tool-win64
path: artifact