Merge pull request #515 from Yubico/jokkon/codeqlv3 #969
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.6.1 | |
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.6.1 | |
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.6.1 | |
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 |