-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (138 loc) · 6.38 KB
/
Copy pathrelease.yml
File metadata and controls
159 lines (138 loc) · 6.38 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Build & Release
on:
push:
tags:
- 'v*'
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Build IcarusInjector
run: msbuild native/injector/IcarusInjector.vcxproj /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143
- name: Fetch native dependencies (ImGui + MinHook)
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$libs = "native/third_party"
New-Item -ItemType Directory -Force -Path "$libs/imgui" | Out-Null
New-Item -ItemType Directory -Force -Path "$libs/minhook" | Out-Null
# --- ImGui v1.91.8 ---
$imguiTag = "v1.91.8"
$imguiZip = "$env:RUNNER_TEMP/imgui.zip"
$imguiDir = "$env:RUNNER_TEMP/imgui-extract"
Invoke-WebRequest "https://github.com/ocornut/imgui/archive/refs/tags/$imguiTag.zip" -OutFile $imguiZip
if (Test-Path $imguiDir) { Remove-Item $imguiDir -Recurse -Force }
Expand-Archive -Path $imguiZip -DestinationPath $imguiDir
$imguiSrc = (Get-ChildItem $imguiDir -Directory | Select-Object -First 1).FullName
$imguiCore = @(
'imgui.h','imgui.cpp','imgui_internal.h','imconfig.h',
'imgui_draw.cpp','imgui_tables.cpp','imgui_widgets.cpp','imgui_demo.cpp',
'imstb_rectpack.h','imstb_textedit.h','imstb_truetype.h'
)
foreach ($f in $imguiCore) {
if (Test-Path "$imguiSrc/$f") {
Copy-Item "$imguiSrc/$f" "$libs/imgui/" -Force
}
}
$imguiBackends = @(
'imgui_impl_dx11.h','imgui_impl_dx11.cpp',
'imgui_impl_dx12.h','imgui_impl_dx12.cpp',
'imgui_impl_win32.h','imgui_impl_win32.cpp'
)
foreach ($f in $imguiBackends) {
Copy-Item "$imguiSrc/backends/$f" "$libs/imgui/" -Force
}
# --- MinHook (master) ---
$mhZip = "$env:RUNNER_TEMP/minhook.zip"
$mhDir = "$env:RUNNER_TEMP/minhook-extract"
Invoke-WebRequest "https://github.com/TsudaKageyu/minhook/archive/refs/heads/master.zip" -OutFile $mhZip
if (Test-Path $mhDir) { Remove-Item $mhDir -Recurse -Force }
Expand-Archive -Path $mhZip -DestinationPath $mhDir
$mhSrc = (Get-ChildItem $mhDir -Directory | Select-Object -First 1).FullName
New-Item -ItemType Directory -Force -Path "$libs/minhook/include" | Out-Null
New-Item -ItemType Directory -Force -Path "$libs/minhook/src/hde" | Out-Null
Copy-Item "$mhSrc/include/MinHook.h" "$libs/minhook/include/" -Force
Copy-Item "$mhSrc/src/buffer.c" "$libs/minhook/src/" -Force
Copy-Item "$mhSrc/src/buffer.h" "$libs/minhook/src/" -Force
Copy-Item "$mhSrc/src/hook.c" "$libs/minhook/src/" -Force
Copy-Item "$mhSrc/src/trampoline.c" "$libs/minhook/src/" -Force
Copy-Item "$mhSrc/src/trampoline.h" "$libs/minhook/src/" -Force
Copy-Item "$mhSrc/src/hde/*" "$libs/minhook/src/hde/" -Recurse -Force
Write-Host "ImGui + MinHook fetched into $libs"
Get-ChildItem "$libs/imgui" | Select-Object Name | Format-Table
Get-ChildItem "$libs/minhook" -Recurse | Select-Object FullName | Format-Table
- name: Build IcarusInternal
run: msbuild native/internal/IcarusInternal.vcxproj /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v143
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Electron dependencies
run: |
cd app
npm ci
shell: pwsh
- name: Prepare Release
run: |
New-Item -ItemType Directory -Force -Path "release" | Out-Null
New-Item -ItemType Directory -Force -Path "app/bin" | Out-Null
Remove-Item "release\*" -Force -ErrorAction SilentlyContinue
Remove-Item "app\bin\*" -Force -ErrorAction SilentlyContinue
# Copy the exact maintained native outputs into the Electron bundle.
Copy-Item "native/injector/bin/Release/IcarusInjector.exe" "app/bin/IcarusInjector.exe"
Copy-Item "native/internal/bin/Release/IcarusInternal.dll" "app/bin/IcarusInternal.dll"
# Standalone native package
Copy-Item "app/bin/IcarusInjector.exe" "release/"
Copy-Item "app/bin/IcarusInternal.dll" "release/"
Compress-Archive -Path "release/IcarusInjector.exe", "release/IcarusInternal.dll" -DestinationPath "ZeusMod-Standalone-${{ github.ref_name }}.zip"
# Electron installer
cd app
npm run dist
cd ..
shell: pwsh
- name: Build release notes from CHANGELOG + footer template
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$version = $tag -replace '^v', ''
$raw = Get-Content CHANGELOG.md -Raw
$start = $raw.IndexOf("## [$version]")
if ($start -lt 0) {
Write-Host "No CHANGELOG entry for $version - using fallback"
$section = "_No changelog entry for this version._"
} else {
$after = $raw.Substring($start)
$eol = $after.IndexOf("`n")
$tail = $after.Substring($eol + 1)
$next = $tail.IndexOf("`n## [")
if ($next -gt 0) {
$section = $tail.Substring(0, $next).Trim()
} else {
$section = $tail.Trim()
}
}
$footer = (Get-Content .github/release-footer.md -Raw) -replace '\{\{TAG\}\}', $tag
$header = "## ZeusMod $tag`n`n"
$body = $header + $section + "`n`n" + $footer
$body | Out-File -FilePath release_notes.md -Encoding utf8 -NoNewline
Write-Host "=== release_notes.md ==="
Get-Content release_notes.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
ZeusMod-Standalone-${{ github.ref_name }}.zip
app/dist/ZeusMod-Setup-*.exe
app/dist/ZeusMod-Setup-*.exe.blockmap
app/dist/latest.yml
body_path: release_notes.md
draft: false
prerelease: false