Repository navigation
104 lines (88 loc) · 3.72 KB
/
Copy pathrelease.yml
File metadata and controls
104 lines (88 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Release
# Build the desktop release and publish it as a GitHub Release.
# Layout (since 2026-09):
# dist/Alas/Alas.exe the launcher (GUI subsystem, owns the data dir
# and the tray; starts the sidecar without a console)
# dist/alas-backend/ the PyInstaller onedir sidecar (console subsystem,
# so tracebacks reach backend.log instead of a modal
# dialog), plus version.txt
# The installed app's updater (module/webui/updater.py) lists releases,
# downloads the setup exe and runs it with `/S /R`.
on:
push:
# Version tags (vYYYY.MM.DD, e.g. v2026.10.01); see deploy/packaging/README.md
tags: ["v*"]
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Set up Python 3.13
run: uv python install 3.13
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 11
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 24
# Main dependency group only; the dev group is not needed to package.
- name: Sync dependencies
run: uv sync --frozen --no-group dev
- name: Build frontend
working-directory: webapp
run: |
pnpm install --frozen-lockfile
pnpm build
- name: Render the app icon
run: uv run python dev_tools/gen_app_icon.py
- name: Build the backend sidecar
run: |
uv tool install "pyinstaller>=6.19"
$env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH"
pyinstaller --clean --noconfirm deploy/packaging/alas_backend.spec
# version.txt = the release tag; the updater reports it as the
# current version of the running build.
Set-Content -Path "dist/alas-backend/version.txt" -Value "$env:GITHUB_REF_NAME" -NoNewline
- name: Build the launcher
run: |
$env:PATH = "$env:USERPROFILE\.local\bin;$env:PATH"
pyinstaller --clean --noconfirm deploy/packaging/launcher.spec
# Smoke the two executables before shipping them: a bundle that cannot
# even report its version would otherwise be published as a release.
- name: Smoke the built executables
shell: pwsh
run: |
$sidecar = "dist/alas-backend/alas-backend.exe"
& $sidecar version
if ($LASTEXITCODE -ne 0) { throw "sidecar version failed" }
if (-not (Test-Path "dist/Alas/Alas.exe")) { throw "launcher missing" }
& "dist/Alas/Alas.exe" --help 2>&1 | Out-Null
"sidecar and launcher present"
- name: Build the installer
id: build
shell: pwsh
run: |
$nsi = "deploy/packaging/alas_installer.nsi"
if (-not (Test-Path $nsi)) {
Write-Host "alas_installer.nsi missing - falling back to a portable zip"
Compress-Archive -Path "dist/Alas", "dist/alas-backend" -DestinationPath "Alas_${{ github.ref_name }}_x64-portable.zip" -Force
"asset=Alas_${{ github.ref_name }}_x64-portable.zip" >> $env:GITHUB_OUTPUT
exit 0
}
makensis "/DVERSION=${{ github.ref_name }}" $nsi
$asset = "Alas_${{ github.ref_name }}_x64-setup.exe"
if (-not (Test-Path $asset)) { throw "makensis did not produce $asset" }
"asset=$asset" >> $env:GITHUB_OUTPUT
Get-ChildItem "Alas_*" | ForEach-Object { $_.FullName }
- name: Publish release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: ${{ steps.build.outputs.asset }}