102 lines
3.5 KiB
YAML
102 lines
3.5 KiB
YAML
name: Windows release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_tag:
|
|
description: Existing GitHub release tag to receive the Windows installer
|
|
required: true
|
|
default: v2.0.0-alpha.31
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-windows:
|
|
runs-on: windows-2025
|
|
timeout-minutes: 45
|
|
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v5
|
|
with:
|
|
node-version: 22
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Verify source
|
|
run: |
|
|
npm run typecheck
|
|
npm run test:run
|
|
|
|
- name: Build and verify Aurora Native for Windows
|
|
shell: pwsh
|
|
run: |
|
|
$ErrorActionPreference = 'Stop'
|
|
$PSNativeCommandUseErrorActionPreference = $true
|
|
./runtime-build/windows-x64/stage-runtime.ps1
|
|
node scripts/smoke-native-runtime.cjs dist/native-runtime-stage/win32-x64
|
|
$runtime = (Resolve-Path 'dist/native-runtime-stage/win32-x64').Path
|
|
$env:AURORA_NATIVE_SMOKE_ROOT = $runtime
|
|
$env:AURORA_NATIVE_WORDPRESS_SMOKE_ROOT = $runtime
|
|
npx vitest run src/main/native/nativeProject.test.ts
|
|
node scripts/package-native-runtime.cjs dist/native-runtime-stage/win32-x64 dist/native-runtime/aurora-native-0.1.0-win32-x64.tar.gz
|
|
|
|
- name: Read application version
|
|
shell: pwsh
|
|
run: |
|
|
$version = node -p "require('./package.json').version"
|
|
"APP_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
|
|
|
|
- name: Build Windows installer
|
|
env:
|
|
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
|
run: npm run build:win
|
|
|
|
- name: Verify installer and create checksum
|
|
shell: pwsh
|
|
run: |
|
|
$installer = "dist/aurora-dockside-$env:APP_VERSION-setup.exe"
|
|
if (-not (Test-Path $installer)) { throw "Missing Windows installer: $installer" }
|
|
$hash = (Get-FileHash -Algorithm SHA256 $installer).Hash.ToLowerInvariant()
|
|
"$hash $(Split-Path $installer -Leaf)" | Set-Content dist/SHA256SUMS-windows.txt
|
|
Get-Content dist/SHA256SUMS-windows.txt
|
|
|
|
- name: Upload Windows release bundle
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: aurora-dockside-windows-x64
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
path: |
|
|
dist/*-setup.exe
|
|
dist/latest.yml
|
|
dist/SHA256SUMS-windows.txt
|
|
dist/module-catalog/*.pac
|
|
dist/native-runtime/aurora-native-0.1.0-win32-x64.tar.gz
|
|
|
|
- name: Publish Windows assets
|
|
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
|
|
shell: pwsh
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
RELEASE_TAG: ${{ github.event.inputs.release_tag || github.ref_name }}
|
|
run: |
|
|
gh release view "$env:RELEASE_TAG" --repo "$env:GITHUB_REPOSITORY" 2>$null | Out-Null
|
|
if ($LASTEXITCODE -ne 0) {
|
|
gh release create "$env:RELEASE_TAG" --repo "$env:GITHUB_REPOSITORY" --prerelease --title "Aurora Dockside $env:RELEASE_TAG" --notes "Cross-platform Aurora Dockside testing release."
|
|
}
|
|
gh release upload "$env:RELEASE_TAG" `
|
|
--repo "$env:GITHUB_REPOSITORY" `
|
|
"dist/aurora-dockside-$env:APP_VERSION-setup.exe" `
|
|
"dist/SHA256SUMS-windows.txt" `
|
|
--clobber
|