6565 cache-key-prefix : rust-build-${{ matrix.target }}
6666 - name : Install frontend dependencies
6767 run : npm install
68- - name : Set Version
69- run : |
70- npx tsx scripts/versionish.ts release v${{ env.PACKAGE_VERSION }}
68+
7169 - name : Build Hook DLL
7270 run : cargo build --release --target ${{ matrix.target }} -p sluhk
7371 - name : Build (no bundle)
@@ -88,10 +86,10 @@ jobs:
8886 needs : build-binaries
8987 runs-on : ubuntu-latest
9088 outputs :
91- artifact-id : ${{ steps.merge.outputs.artifact-id }}
89+ artifact-id : ${{ steps.merge-binaries .outputs.artifact-id }}
9290 steps :
9391 - name : Merge binaries artifacts
94- id : merge
92+ id : merge-binaries
9593 uses : actions/upload-artifact/merge@v4
9694 with :
9795 name : binaries
@@ -102,10 +100,8 @@ jobs:
102100 sign-binaries :
103101 needs : merge-binaries
104102 runs-on : ubuntu-latest
105- permissions :
106- contents : write
107103 steps :
108- - name : Submit binaries to SignPath
104+ - name : Sign binaries with SignPath
109105 uses : signpath/github-action-submit-signing-request@v1
110106 with :
111107 api-token : ${{ secrets.SIGNPATH_API_TOKEN }}
@@ -117,46 +113,22 @@ jobs:
117113 output-artifact-directory : signed-binaries
118114 wait-for-completion : true
119115
120- - name : List signed binaries
121- run : tree -a signed-binaries || true
122-
123- - name : Clean existing binary assets from release (optional)
124- uses : actions/github-script@v7
116+ - name : Upload signed binaries by target
117+ uses : actions/upload-artifact@v4
125118 with :
126- github-token : ${{ secrets.GITHUB_TOKEN }}
127- script : |
128- const tagName = `v${process.env.PACKAGE_VERSION}`;
129- const release = await github.rest.repos.getReleaseByTag({
130- owner: context.repo.owner,
131- repo: context.repo.repo,
132- tag: tagName,
133- });
134- const { data: assets } = await github.rest.repos.listReleaseAssets({
135- owner: context.repo.owner,
136- repo: context.repo.repo,
137- release_id: release.data.id,
138- });
139- core.info(`Found ${assets.length} existing assets to clean`);
140- // Delete assets that look like binaries (optional filtering)
141- const deletions = assets
142- .filter(a => a.name && a.name.toLowerCase().includes('seelen ui') || a.name && a.name.toLowerCase().includes('binaries'))
143- .map(asset => github.rest.repos.deleteReleaseAsset({
144- owner: context.repo.owner,
145- repo: context.repo.repo,
146- asset_id: asset.id,
147- }));
148- await Promise.all(deletions);
149- core.info('✅ Existing binary-related assets cleaned');
150-
151- - name : Upload signed binaries to release
152- uses : softprops/action-gh-release@v2
119+ name : signed-binaries-x86_64-pc-windows-msvc
120+ path : signed-binaries/binaries-x86_64-pc-windows-msvc/**/*
121+
122+ - name : Upload signed binaries by target
123+ uses : actions/upload-artifact@v4
153124 with :
154- tag_name : v${{ env.PACKAGE_VERSION }}
155- name : Seelen UI v${{ env.PACKAGE_VERSION }} - Signed Binaries
156- files : signed-binaries/**/*
125+ name : signed-binaries-aarch64-pc-windows-msvc
126+ path : signed-binaries/binaries-aarch64-pc-windows-msvc/**/*
157127
158- build-bundles :
159- needs : sign-binaries
128+ bundle :
129+ needs :
130+ - create-release
131+ - sign-binaries
160132 strategy :
161133 fail-fast : false
162134 matrix :
@@ -165,30 +137,37 @@ jobs:
165137 target : x86_64-pc-windows-msvc
166138 - platform : windows-2025
167139 target : aarch64-pc-windows-msvc
140+
168141 runs-on : ${{ matrix.platform }}
169142 steps :
170143 - uses : actions/checkout@v4
144+ with :
145+ lfs : true # needed to fetch fixed runtimes (.cab) files
171146 - uses : ./.github/actions/setup
172147 with :
173148 rust-targets : ${{ matrix.target }}
174149 cache-key-prefix : rust-bundle-${{ matrix.target }}
150+
175151 - name : Install frontend dependencies
176152 run : npm install
153+
177154 - name : Install MSIX dependencies
178155 shell : pwsh
179156 run : |
180157 winget upgrade winget --accept-package-agreements --accept-source-agreements --disable-interactivity --force || Write-Output "Ignoring winget update failure"
181158 winget install --id Microsoft.DotNet.AspNetCore.8 --accept-package-agreements --accept-source-agreements --force
182159 winget install --id Microsoft.DotNet.DesktopRuntime.8 --accept-package-agreements --accept-source-agreements --force
183160 winget install --id MarcinOtorowski.MSIXHero --accept-package-agreements --accept-source-agreements --force
184- - name : Set Version
185- run : |
186- npx tsx scripts/versionish.ts release v${{ env.PACKAGE_VERSION }}
187- - name : Download signed binaries for target
161+
162+ - name : Get version
163+ run : echo "PACKAGE_VERSION=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV
164+
165+ - name : Download signed binaries
188166 uses : actions/download-artifact@v4
189167 with :
190168 name : signed-binaries-${{ matrix.target }}
191169 path : target/${{ matrix.target }}/release
170+
192171 - name : Clean bundle folder from cache
193172 shell : pwsh
194173 run : |
@@ -197,37 +176,107 @@ jobs:
197176 Remove-Item -Path $bundlePath -Recurse -Force
198177 Write-Output "Old bundles files deleted: $bundlePath"
199178 }
200- - name : Bundle (no signing here — SignPath / tauri signer later)
179+
180+ - name : Bundle
181+ run : npx tauri bundle --ci --verbose --target ${{ matrix.target }} --no-sign
182+
183+ - name : Rename normal bundle to temp
184+ shell : pwsh
185+ run : |
186+ $arch = "${{ matrix.target }}".Contains("aarch64") ? "arm64" : "x64"
187+ $version = $env:PACKAGE_VERSION
188+ $bundlePath = "target/${{ matrix.target }}/release/bundle/nsis"
189+ $setupFile = "$bundlePath/Seelen UI_${version}_${arch}-setup.exe"
190+ $tempFile = "$bundlePath/Seelen UI_${version}_${arch}-setup_temp.exe"
191+
192+ if (Test-Path $setupFile) {
193+ Move-Item -Path $setupFile -Destination $tempFile
194+ Write-Output "Renamed $setupFile to $tempFile"
195+ }
196+
197+ - name : Set Fixed Runtime
198+ shell : pwsh
199+ run : |
200+ $arch = "${{ matrix.target }}".Contains("aarch64") ? "arm64" : "x64"
201+ ./scripts/SetFixedRuntime.ps1 -Architecture $arch
202+
203+ - name : Copy Runtime to target directory
204+ shell : pwsh
205+ run : |
206+ $runtimeSource = Get-ChildItem -Path "src/runtime" -Directory | Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | Select-Object -First 1
207+ if ($runtimeSource) {
208+ $targetRuntimeDir = "target/${{ matrix.target }}/release/runtime"
209+ New-Item -ItemType Directory -Force -Path $targetRuntimeDir | Out-Null
210+ Copy-Item -Path $runtimeSource.FullName -Destination "$targetRuntimeDir/$($runtimeSource.Name)" -Recurse -Force
211+ Write-Output "Copied runtime from $($runtimeSource.FullName) to $targetRuntimeDir/$($runtimeSource.Name)"
212+ } else {
213+ Write-Error "Runtime version directory not found in src/runtime"
214+ exit 1
215+ }
216+
217+ - name : Bundle with Fixed Runtime
201218 run : npx tauri bundle --ci --verbose --target ${{ matrix.target }} --no-sign
219+
220+ - name : Rename bundles
221+ shell : pwsh
222+ run : |
223+ $arch = "${{ matrix.target }}".Contains("aarch64") ? "arm64" : "x64"
224+ $version = $env:PACKAGE_VERSION
225+ $bundlePath = "target/${{ matrix.target }}/release/bundle/nsis"
226+ $tempFile = "$bundlePath/Seelen UI_${version}_${arch}-setup_temp.exe"
227+ $normalFile = "$bundlePath/Seelen UI_${version}_${arch}-setup.exe"
228+ $fixedFile = "$bundlePath/Seelen UI_${version}_${arch}-setup-fixed.exe"
229+
230+ if (Test-Path $normalFile) {
231+ Move-Item -Path $normalFile -Destination $fixedFile
232+ Write-Output "Renamed fixed runtime bundle to $fixedFile"
233+ }
234+
235+ if (Test-Path $tempFile) {
236+ Move-Item -Path $tempFile -Destination $normalFile
237+ Write-Output "Renamed normal bundle back to $normalFile"
238+ }
239+
202240 - name : Bundle MSIX
203241 run : npx tsx scripts/bundle.msix.ts --target ${{ matrix.target }}
242+
204243 - name : Upload bundles to artifacts
205244 uses : actions/upload-artifact@v4
206245 with :
207- name : build- bundles-${{ matrix.target }}
246+ name : bundles-${{ matrix.target }}
208247 path : target/${{ matrix.target }}/release/bundle
209248
210249 merge-bundles :
211- needs : build-bundles
250+ needs : bundle
212251 runs-on : ubuntu-latest
213252 outputs :
214- artifact-id : ${{ steps.merge-bundles .outputs.artifact-id }}
253+ artifact-id : ${{ steps.upload-merged .outputs.artifact-id }}
215254 steps :
216- - name : Merge bundles artifacts
217- id : merge-bundles
255+ - name : Merge artifacts
256+ id : upload-merged
218257 uses : actions/upload-artifact/merge@v4
219258 with :
220259 name : bundles
221- pattern : build- bundles-*
260+ pattern : bundles-*
222261 delete-merged : true
223262
224263 sign-bundles :
225- needs : merge-bundles
226- runs-on : ubuntu-latest
264+ needs :
265+ - create-release
266+ - merge-bundles
227267 permissions :
228268 contents : write
269+ runs-on : ubuntu-latest
229270 steps :
230- - name : Submit bundles to SignPath
271+ - uses : actions/checkout@v4
272+ - uses : actions/setup-node@v4
273+ with :
274+ node-version : 20
275+
276+ - name : Get version
277+ run : echo "PACKAGE_VERSION=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV
278+
279+ - name : Submit to SignPath
231280 uses : signpath/github-action-submit-signing-request@v1
232281 with :
233282 api-token : ${{ secrets.SIGNPATH_API_TOKEN }}
@@ -237,31 +286,30 @@ jobs:
237286 artifact-configuration-slug : bundles
238287 github-artifact-id : ${{ needs.merge-bundles.outputs.artifact-id }}
239288 output-artifact-directory : bundles
240- wait-for-completion : true
241289
242- - name : File Tree of signed bundles
290+ - name : File Tree
243291 run : |-
244- tree bundles || true
292+ tree bundles
245293
246- - name : Tauri Updater Signature (regenerate .sig with private key)
294+ - name : Tauri Updater Signature
247295 env :
248296 TAURI_PRIVATE_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
249297 TAURI_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
250298 run : |
251299 npm install -g @tauri-apps/cli
300+
252301 echo "Removing existing .sig files to regenerate with Tauri updater keys..."
253- find ./bundles -name "*.sig" -type f -delete || true
302+ find ./bundles -name "*.sig" -type f -delete
303+ echo "Existing signatures removed"
304+
254305 VERSION=${{ env.PACKAGE_VERSION }}
255306 PATH1="bundles/nsis/Seelen UI_${VERSION}_arm64-setup.exe"
256307 PATH2="bundles/nsis/Seelen UI_${VERSION}_x64-setup.exe"
257- if [ -f "$PATH1" ]; then
258- echo "Signing ${PATH1}..."
259- tauri signer sign --verbose -k "$TAURI_PRIVATE_KEY" -p "$TAURI_PRIVATE_KEY_PASSWORD" "$PATH1"
260- fi
261- if [ -f "$PATH2" ]; then
262- echo "Signing ${PATH2}..."
263- tauri signer sign --verbose -k "$TAURI_PRIVATE_KEY" -p "$TAURI_PRIVATE_KEY_PASSWORD" "$PATH2"
264- fi
308+
309+ echo "Signing ${PATH1}..."
310+ tauri signer sign --verbose "$PATH1"
311+ echo "Signing ${PATH2}..."
312+ tauri signer sign --verbose "$PATH2"
265313
266314 - name : Remove self-signed MSIX files (store-signed handled elsewhere)
267315 run : |
@@ -273,11 +321,12 @@ jobs:
273321 uses : softprops/action-gh-release@v2
274322 with :
275323 tag_name : v${{ env.PACKAGE_VERSION }}
276- name : Seelen UI v${{ env.PACKAGE_VERSION }} - Signed Bundles
324+ name : Seelen UI v${{ env.PACKAGE_VERSION }}
325+ prerelease : false
277326 files : bundles/**/*
278327
279328 publish-release :
280- needs : [create-release, sign-binaries, sign- bundles]
329+ needs : [create-release, sign-bundles]
281330 permissions :
282331 contents : write
283332 runs-on : ubuntu-latest
@@ -296,6 +345,30 @@ jobs:
296345 draft: false,
297346 });
298347
348+ microsoft-store-submission :
349+ needs : [publish-release, merge-bundles]
350+ runs-on : windows-2025
351+ steps :
352+ - uses : actions/checkout@v4
353+
354+ - name : Download merged bundles (unsigned)
355+ uses : actions/download-artifact@v4
356+ with :
357+ name : bundles
358+ path : target/release/bundle
359+
360+ # Use Store Broker to publish to Microsoft Store
361+ - name : Submit to Partner Center (aka DevCenter)
362+ shell : pwsh
363+ run : |
364+ ./scripts/SubmitToStore.ps1
365+ env :
366+ PartnerCenterStoreId : ${{ secrets.MS_PRODUCT_ID }}
367+ PartnerCenterTenantId : ${{ secrets.MS_TENANT_ID }}
368+ PartnerCenterClientId : ${{ secrets.MS_CLIENT_ID }}
369+ PartnerCenterClientSecret : ${{ secrets.MS_CLIENT_SECRET }}
370+ SBDisableTelemetry : true
371+
299372 generate-update-file :
300373 needs : [create-release, publish-release]
301374 permissions :
0 commit comments