-
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (62 loc) · 2.23 KB
/
Copy pathrelease.yml
File metadata and controls
75 lines (62 loc) · 2.23 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
66
67
68
69
70
71
72
73
74
75
name: release
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Verify tag matches Cargo.toml version
shell: pwsh
run: |
$tagVersion = "${{ github.ref_name }}" -replace '^v', ''
$cargoToml = Get-Content Cargo.toml -Raw
if ($cargoToml -notmatch '(?m)^version\s*=\s*"([^"]+)"') {
throw "Could not parse package version from Cargo.toml"
}
$cargoVersion = $Matches[1]
if ($cargoVersion -ne $tagVersion) {
throw "Tag version '$tagVersion' does not match Cargo.toml version '$cargoVersion'"
}
- name: Build release
run: cargo build --release --locked
- name: Package portable zip
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$dir = "panopticon-$tag-x86_64-pc-windows-msvc"
New-Item -ItemType Directory -Path $dir | Out-Null
Copy-Item target/release/panopticon.exe $dir/
Copy-Item README.md $dir/
Copy-Item LICENSE $dir/
Compress-Archive -Path $dir -DestinationPath "$dir.zip"
- name: Install Inno Setup
shell: pwsh
run: choco install innosetup --yes --no-progress
- name: Build installer
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^v', ''
$iscc = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
New-Item -ItemType Directory -Path dist -Force | Out-Null
& $iscc /DAppVersion="$version" installer\panopticon.iss
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Move-Item "dist\panopticon-$version-setup.exe" "panopticon-$tag-setup.exe"
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
panopticon-*-x86_64-pc-windows-msvc.zip
panopticon-*-setup.exe