Skip to content

Commit 2b7225d

Browse files
Dev: add ms build
1 parent 6ca3670 commit 2b7225d

11 files changed

Lines changed: 740 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ jobs:
155155
- name: Rust toolchain
156156
uses: dtolnay/rust-toolchain@stable
157157

158+
- name: Install Windows Rust targets
159+
if: matrix.platform == 'windows'
160+
run: rustup target add x86_64-pc-windows-msvc aarch64-pc-windows-msvc
161+
158162
- name: Setup sccache
159163
uses: mozilla-actions/sccache-action@v0.0.9
160164

@@ -253,6 +257,71 @@ jobs:
253257
gh release upload "$TAG" "$staged_asset" --clobber
254258
done
255259
260+
- name: Install MSIX bundle tool
261+
if: matrix.platform == 'windows'
262+
run: cargo install msixbundle-cli
263+
264+
- name: Configure Microsoft Store package
265+
if: matrix.platform == 'windows'
266+
shell: pwsh
267+
env:
268+
MSIX_PUBLISHER: ${{ secrets.MSIX_PUBLISHER }}
269+
MSIX_PUBLISHER_DISPLAY_NAME: ${{ secrets.MSIX_PUBLISHER_DISPLAY_NAME }}
270+
MSIX_PFX_BASE64: ${{ secrets.MSIX_PFX_BASE64 }}
271+
run: |
272+
if (-not $env:MSIX_PUBLISHER) {
273+
throw "MSIX_PUBLISHER secret is required to build a Microsoft Store package in CI."
274+
}
275+
276+
$configPath = "src-tauri/gen/windows/bundle.config.json"
277+
$config = Get-Content $configPath -Raw | ConvertFrom-Json
278+
279+
if ($env:MSIX_PUBLISHER) {
280+
$config.publisher = $env:MSIX_PUBLISHER
281+
}
282+
283+
if ($env:MSIX_PUBLISHER_DISPLAY_NAME) {
284+
$config.publisherDisplayName = $env:MSIX_PUBLISHER_DISPLAY_NAME
285+
}
286+
287+
if ($env:MSIX_PFX_BASE64) {
288+
$pfxPath = Join-Path $env:RUNNER_TEMP "msix-signing.pfx"
289+
[IO.File]::WriteAllBytes($pfxPath, [Convert]::FromBase64String($env:MSIX_PFX_BASE64))
290+
$config.signing.pfx = $pfxPath
291+
$config.signing.pfxPassword = $null
292+
}
293+
294+
$config | ConvertTo-Json -Depth 20 | Set-Content $configPath
295+
296+
- name: Build Microsoft Store MSIX bundle
297+
if: matrix.platform == 'windows'
298+
env:
299+
MSIX_PFX_PASSWORD: ${{ secrets.MSIX_PFX_PASSWORD }}
300+
run: npm run tauri:windows:build -- --arch x64,arm64 --runner npm --verbose
301+
302+
- name: Upload Microsoft Store MSIX bundle
303+
if: matrix.platform == 'windows'
304+
env:
305+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
306+
TAG: ${{ needs.prepare.outputs.tag }}
307+
VERSION: ${{ needs.prepare.outputs.version }}
308+
shell: bash
309+
run: |
310+
mkdir -p staged
311+
shopt -s nullglob
312+
313+
bundles=(src-tauri/target/msix/*.msixbundle)
314+
if (( ${#bundles[@]} == 0 )); then
315+
echo "::error::No Microsoft Store MSIX bundle found"
316+
exit 1
317+
fi
318+
319+
for bundle in "${bundles[@]}"; do
320+
staged_asset="staged/Sigma-File-Manager-${VERSION}-windows-store.msixbundle"
321+
cp "$bundle" "$staged_asset"
322+
gh release upload "$TAG" "$staged_asset" --clobber
323+
done
324+
256325
- name: Upload Linux binary
257326
if: matrix.platform == 'linux'
258327
env:

0 commit comments

Comments
 (0)