Skip to content

Githubactions: Fix go installation #82

Githubactions: Fix go installation

Githubactions: Fix go installation #82

name: "Building release binaries on Windows"
on: [push]
jobs:
Windows-Build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build binary
run: |
$ErrorActionPreference = "Stop"
Set-PSDebug -Trace 1
mkdir artifact
choco install -y golang --version=1.17
refreshenv
go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo
$env:Path += ";C:\Users\runneradmin\go\bin"
go mod tidy
go generate ./...
go build -o bin/yubihsm-connector.exe
cp bin/yubihsm-connector.exe artifact\
./bin/yubihsm-connector.exe version
./bin/yubihsm-connector.exe --help
cd resources/win-installer
& cmd /c '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild YubiHSMConnectorInstaller.sln /p:Configuration=Release'
cp x64/Release/yubihsm-connector-windows-amd64.msi ../../artifact/
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: yubihsm-connector-windows-amd64
path: artifact