97 lines
3 KiB
YAML
97 lines
3 KiB
YAML
name: Build Dragon Wind Desktop
|
|
|
|
# Runs on every push to main and on version tags.
|
|
# Self-hosted runner (TrueNAS) handles Linux builds.
|
|
# Windows .exe is built via manual trigger on a Windows machine,
|
|
# or by adding a Windows runner in future.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch: # allow manual trigger from Forgejo UI
|
|
|
|
jobs:
|
|
# ── Linux AppImage (self-hosted TrueNAS runner) ───────────────────────────
|
|
build-linux:
|
|
name: Linux (AppImage)
|
|
runs-on: ubuntu-latest # matched by truenas-runner label
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Install Linux native deps
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y --no-install-recommends \
|
|
libgtk-3-dev libnotify-dev libnss3 libxss1 \
|
|
libgbm-dev libasound2-dev
|
|
|
|
- name: Build Linux AppImage
|
|
run: npm run build:linux
|
|
env:
|
|
# electron-builder needs this so it doesn't try to notarise
|
|
CSC_IDENTITY_AUTO_DISCOVERY: false
|
|
|
|
- name: Upload AppImage artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: dragon-wind-linux-${{ github.sha }}
|
|
path: dist/*.AppImage
|
|
retention-days: 30
|
|
|
|
# ── Windows .exe (NOTE: needs a Windows runner) ───────────────────────────
|
|
# To enable this job:
|
|
# 1. Set up a Windows machine with the Forgejo runner agent
|
|
# 2. Register it with label: windows-latest
|
|
# Then uncomment this job.
|
|
#
|
|
# build-windows:
|
|
# name: Windows (.exe)
|
|
# runs-on: windows-latest
|
|
# steps:
|
|
# - uses: actions/checkout@v4
|
|
# - uses: actions/setup-node@v4
|
|
# with: { node-version: '20', cache: 'npm' }
|
|
# - run: npm ci
|
|
# - run: npm run build:win
|
|
# env: { GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }
|
|
# - uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: dragon-wind-windows-${{ github.sha }}
|
|
# path: dist/*.exe
|
|
# retention-days: 30
|
|
|
|
# ── Release (on tag push only) ────────────────────────────────────────────
|
|
release:
|
|
name: Create Release
|
|
needs: [build-linux]
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
steps:
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts/
|
|
|
|
- name: List artifacts
|
|
run: find artifacts/ -type f
|
|
|
|
- name: Create Forgejo Release
|
|
uses: https://code.forgejo.org/forgejo/release-action@v1
|
|
with:
|
|
direction: upload
|
|
release-dir: artifacts/
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|