Skip to content

fix(daemon): ResolveExecutable platform-aware (mariadbd, no .exe on U… #22

fix(daemon): ResolveExecutable platform-aware (mariadbd, no .exe on U…

fix(daemon): ResolveExecutable platform-aware (mariadbd, no .exe on U… #22

Workflow file for this run

name: Build & Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
target: win
daemon_rid: win-x64
npm_script: dist
upload_glob: |
src/frontend/release/*.exe
src/frontend/release/*.blockmap
src/frontend/release/latest.yml
- os: macos-14
target: mac
daemon_rid: osx-arm64
npm_script: dist:mac
upload_glob: |
src/frontend/release/*.dmg
src/frontend/release/*.zip
src/frontend/release/latest-mac.yml
- os: ubuntu-24.04
target: linux
daemon_rid: linux-x64
npm_script: dist:linux
upload_glob: |
src/frontend/release/*.AppImage
src/frontend/release/latest-linux.yml
runs-on: ${{ matrix.os }}
# Full release build (daemon publish + frontend bundle + installer pack)
# runs ~10m per matrix leg; 40m covers worst-case macOS-slow + NSIS packer.
timeout-minutes: 40
steps:
- uses: actions/checkout@v6
- name: Setup .NET 9
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Generate macOS .icns icon
if: matrix.target == 'mac'
run: |
if [ ! -f src/frontend/build/icon.icns ]; then
sips -s format icns src/frontend/build/icon.png --out src/frontend/build/icon.icns
fi
shell: bash
- name: Build daemon
run: dotnet publish src/daemon/NKS.WebDevConsole.Daemon/NKS.WebDevConsole.Daemon.csproj -c Release -r ${{ matrix.daemon_rid }} --self-contained -o src/frontend/resources/daemon
- name: Build solution (plugins + tests)
run: dotnet build WebDevConsole.sln -c Release
- name: Install frontend dependencies
working-directory: src/frontend
run: npm ci
- name: Build Electron app
working-directory: src/frontend
run: npm run ${{ matrix.npm_script }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# stage-plugins.mjs reads GITHUB_TOKEN to auth GitHub API calls
# when fetching plugin release zips. Unauthenticated is 60/hr per
# IP — macOS runners share NAT and burn through that fast, which
# caused v0.2.5's DMG to ship without any plugins. 5000/hr when
# authenticated covers it.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Skip auto-publish from electron-builder; we publish via softprops/action-gh-release below.
EP_PRE_RELEASE: 'false'
# Disable code-signing on CI runners — they don't have a Developer ID
# certificate, and electron-builder's auto-discovery would otherwise
# try to sign with whatever it finds in the runner's keychain.
# NOTE: do NOT set CSC_LINK='' or APPLE_ID='' — empty strings get
# path.resolve()d against CWD by app-builder-lib, producing
# "<cwd> not a file" failures. Leave them unset.
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
- name: Verify release artifacts
run: node scripts/verify-electron-release.mjs --dir src/frontend/release --target ${{ matrix.target }}
shell: bash
# Skipped on CI: daemon app.manifest is requireAdministrator so the
# packaged Electron app triggers a UAC prompt at launch. Headless
# GitHub Actions runners can't dismiss UAC — the bootstrap stalls
# and the step times out. Developers run this manually on elevated
# shells before shipping. Release tag workflow still builds the
# signed installer, which is what ships to users.
# - name: Smoke packaged Electron runtime
# if: matrix.target == 'win'
# working-directory: src/frontend
# run: npm run smoke:packaged:win
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.target }}
path: src/frontend/release/**
# Upload release assets per-platform. Each matrix job publishes only
# the extensions it actually produces so the "Pattern does not match
# any files" log noise goes away. generate_release_notes is gated
# to the Windows job (first in the matrix) so the 3 parallel jobs
# don't race each other on the same API call — which produced
# HttpError: Server Error on the v0.2.0 tag push.
- name: Publish to GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v3
with:
fail_on_unmatched_files: false
draft: false
prerelease: false
generate_release_notes: ${{ matrix.target == 'win' }}
files: ${{ matrix.upload_glob }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}