ci: build Windows release package
Some checks failed
Build Windows Release / build-windows (push) Has been cancelled

This commit is contained in:
luochen570
2026-05-29 22:59:55 +08:00
parent 8c9a92f2cb
commit 2a70d6245e
9 changed files with 183 additions and 224 deletions

View File

@@ -0,0 +1,49 @@
name: Build Windows Release
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure MSVC environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build and package Windows app
shell: pwsh
run: |
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force
.\scripts\package-windows-release.ps1 -Toolchain msvc
- name: Verify package
shell: pwsh
run: |
if (!(Test-Path .\dist-windows\chengnan-windows-x86_64.zip)) { throw "missing zip" }
if (!(Test-Path .\dist-windows\chengnan-windows-x86_64.zip.sha256)) { throw "missing sha256" }
$zip = Get-Item .\dist-windows\chengnan-windows-x86_64.zip
if ($zip.Length -le 0) { throw "empty zip" }
$hashLine = Get-Content .\dist-windows\chengnan-windows-x86_64.zip.sha256
if ($hashLine -notmatch '^[0-9a-f]{64}\s+chengnan-windows-x86_64\.zip$') { throw "invalid sha256 file" }
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: chengnan-windows-x86_64
path: |
dist-windows/chengnan-windows-x86_64.zip
dist-windows/chengnan-windows-x86_64.zip.sha256
if-no-files-found: error