Repository navigation
57 lines (48 loc) · 1.54 KB
/
Copy pathwindows-build.yml
File metadata and controls
57 lines (48 loc) · 1.54 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
name: Windows build
on:
workflow_dispatch:
push:
tags:
- "v*"
permissions:
contents: read
jobs:
build-windows:
name: Build Windows amd64
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: Generate Windows icon resource
shell: pwsh
run: go generate windows_resources_generate.go
- name: Build Windows executable
shell: pwsh
run: |
New-Item -ItemType Directory -Force dist | Out-Null
$buildVersion = "development"
if ($env:GITHUB_REF_TYPE -eq "tag") {
$buildVersion = $env:GITHUB_REF_NAME
}
go build -trimpath -ldflags="-H=windowsgui -X github.com/uija/eqdps/version.Version=$buildVersion" -o dist/eqdps-gui-windows-amd64.exe .
- name: Write SHA-256 checksum
shell: pwsh
run: |
$file = "dist/eqdps-gui-windows-amd64.exe"
$hash = (Get-FileHash $file -Algorithm SHA256).Hash.ToLowerInvariant()
"$hash eqdps-gui-windows-amd64.exe" | Set-Content -Encoding ascii dist/SHA256SUMS
Get-Content dist/SHA256SUMS
- name: Upload Windows build
uses: actions/upload-artifact@v6
with:
name: eqdps-windows-amd64
path: |
dist/eqdps-gui-windows-amd64.exe
dist/SHA256SUMS
if-no-files-found: error
retention-days: 30