50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
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
|