-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (138 loc) · 5.96 KB
/
ci.yml
File metadata and controls
163 lines (138 loc) · 5.96 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
160
161
162
163
name: CI
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build (${{ matrix.platform }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- platform: x86
configuration: Release
output_path: ViStart/bin/Release/
- platform: x64
configuration: Release
output_path: ViStart/bin/x64/Release/
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Verify target framework (XP-compatible)
shell: powershell
run: |
[xml]$project = Get-Content "ViStart/ViStart.csproj"
$tfm = $project.Project.PropertyGroup.TargetFrameworkVersion | Select-Object -First 1
if ($tfm -ne "v4.0") {
throw "Expected TargetFrameworkVersion v4.0, got '$tfm'."
}
- name: Build solution
run: msbuild ViStart.sln /t:Restore,Rebuild /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /m /verbosity:minimal
- name: Prepare release payload
shell: powershell
run: |
New-Item -ItemType Directory -Path artifacts/dist/app -Force | Out-Null
Copy-Item "${{ matrix.output_path }}*" "artifacts/dist/app" -Recurse -Force
Copy-Item "ViStart/Resources" "artifacts/dist/app/Resources" -Recurse -Force
if (Test-Path "ViStart/Languages") {
Copy-Item "ViStart/Languages" "artifacts/dist/Languages" -Recurse -Force
}
- name: Download legacy assets from original ViStart repo
shell: powershell
run: |
$zip = "artifacts/legacy-vistart.zip"
Invoke-WebRequest -Uri "https://codeload.github.com/lee-soft/ViStart/zip/refs/heads/main" -OutFile $zip
Expand-Archive -Path $zip -DestinationPath artifacts -Force
$legacyRoot = "artifacts/ViStart-main"
$folderMap = @{
Languages = @("Languages", "languages")
Skins = @("Skins", "skins")
Orbs = @("Orbs", "orbs")
Rollover = @("Rollover", "rollover")
}
foreach ($target in $folderMap.Keys) {
foreach ($candidate in $folderMap[$target]) {
$sourcePath = Join-Path $legacyRoot $candidate
if (Test-Path $sourcePath) {
Copy-Item $sourcePath (Join-Path "artifacts/dist" $target) -Recurse -Force
break
}
}
}
- name: Normalize legacy skin layout.xml files
shell: powershell
run: |
$skinsRoot = "artifacts/dist/Skins"
if (-not (Test-Path $skinsRoot)) { exit 0 }
$requiredIds = @(
"searchbox","programmenu","frequentprogramsmenu","allprograms_rollover",
"allprograms_arrow","allprograms_text","groupoptions","rolloverplaceholder",
"shutdown_button","logoff_button","arrow_button","jumplist_viewer","shutdown_text"
)
Get-ChildItem -Path $skinsRoot -Recurse -Filter layout.xml | ForEach-Object {
try {
[xml]$xml = Get-Content $_.FullName
if ($null -eq $xml.startmenu_base) { return }
$existingIds = @{}
foreach ($node in $xml.startmenu_base.vielement) {
if ($node.id) { $existingIds[$node.id] = $true }
}
foreach ($id in $requiredIds) {
if (-not $existingIds.ContainsKey($id)) {
$newNode = $xml.CreateElement("vielement")
$newNode.SetAttribute("id", $id)
$newNode.SetAttribute("x", "0")
$newNode.SetAttribute("y", "0")
[void]$xml.startmenu_base.AppendChild($newNode)
}
}
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
[System.IO.File]::WriteAllText($_.FullName, $xml.OuterXml, $utf8NoBom)
}
catch {
Write-Host "Skipping non-parseable layout: $($_.FullName)"
}
}
- name: Build portable zip release
shell: powershell
run: |
$portableRoot = "artifacts/portable/ViStart-${{ matrix.platform }}"
New-Item -ItemType Directory -Path $portableRoot -Force | Out-Null
Copy-Item "artifacts/dist/app/*" $portableRoot -Recurse -Force
foreach ($folder in @("Languages", "Skins", "Orbs", "Rollover")) {
$src = Join-Path "artifacts/dist" $folder
if (Test-Path $src) {
Copy-Item $src (Join-Path $portableRoot $folder) -Recurse -Force
}
}
Compress-Archive -Path "$portableRoot/*" -DestinationPath "artifacts/portable/ViStart-Portable-${{ matrix.platform }}.zip" -Force
- name: Install Inno Setup 5
shell: powershell
run: choco install innosetup --version=5.6.1 --allow-downgrade --force -y --no-progress
- name: Build installer (Inno Setup 5)
shell: powershell
run: |
if (-not (Test-Path "C:\Program Files (x86)\Inno Setup 5\ISCC.exe")) {
throw "Inno Setup 5 was not found after installation step."
}
& "C:\Program Files (x86)\Inno Setup 5\ISCC.exe" "/DMyAppPlatform=${{ matrix.platform }}" "installer/ViStart.iss"
- name: Upload installer artifact
uses: actions/upload-artifact@v7
with:
name: ViStart-Installer-${{ matrix.platform }}
path: artifacts/installer/ViStart-Setup-${{ matrix.platform }}.exe
if-no-files-found: error
archive: false
- name: Upload portable artifact
uses: actions/upload-artifact@v7
with:
name: ViStart-Portable-${{ matrix.platform }}
path: artifacts/portable/ViStart-Portable-${{ matrix.platform }}.zip
if-no-files-found: error
archive: false