-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (56 loc) · 1.77 KB
/
release.yml
File metadata and controls
65 lines (56 loc) · 1.77 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
58
59
60
61
62
63
64
65
# This workflow handles automated releases for PVM.
# Note: "Unable to resolve action" warnings in your IDE are safe to ignore.
# They occur because the IDE cannot pre-validate these actions offline.
# The code is correct and will execute successfully on GitHub.
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Build Windows binary
run: |
cd windows
go build -ldflags "-s -w" -o pvm.exe pvm.go
- name: Build Inno Setup Installer
shell: pwsh
run: |
cd windows
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" pvm-setup.iss
- name: Generate Checksums
shell: pwsh
run: |
$files = @("windows/pvm.exe", "windows/pvm-setup.exe", "pvm.sh", "install.sh")
$hashFile = "CHECKSUMS.sha256"
if (Test-Path $hashFile) { Remove-Item $hashFile }
foreach ($file in $files) {
if (Test-Path $file) {
$hash = (Get-FileHash -Path $file -Algorithm SHA256).Hash.ToLower()
$name = Split-Path $file -Leaf
"$hash $name" | Out-File -FilePath $hashFile -Append -Encoding ascii
}
}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
windows/pvm.exe
windows/pvm-setup.exe
pvm.sh
install.sh
CHECKSUMS.sha256
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}