Files
LanMountainDesktop/.github/workflows/build.yml
2026-04-19 02:12:34 +08:00

156 lines
3.9 KiB
YAML

name: Build
on:
push:
tags-ignore:
- '*'
pull_request:
workflow_dispatch:
env:
DOTNET_VERSION: '10.0.x'
Solution_Name: LanMountainDesktop.slnx
DOTNET_gcServer: 1
jobs:
build-windows:
runs-on: windows-latest
name: Build_Windows_${{ matrix.configuration }}
strategy:
matrix:
configuration: [ Debug, Release ]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: 'preview'
- name: Restore
run: dotnet restore ${{ env.Solution_Name }}
- name: Build
run: dotnet build ${{ env.Solution_Name }} --no-restore -c ${{ matrix.configuration }} -v minimal
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-windows-${{ matrix.configuration }}
path: |
LanMountainDesktop/bin/${{ matrix.configuration }}/
retention-days: 7
build-linux:
runs-on: ubuntu-latest
name: Build_Linux
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libfontconfig1 libfreetype6 \
libx11-6 libxrandr2 libxinerama1 \
libxi6 libxcursor1 libxext6 \
libxrender1 libxkbcommon-x11-0 \
clang zlib1g-dev \
libportaudio2 libasound2 \
libwebkit2gtk-4.1-dev
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: 'preview'
- name: Restore
run: dotnet restore ${{ env.Solution_Name }}
- name: Build
run: dotnet build ${{ env.Solution_Name }} --no-restore -c Release -v minimal
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-linux
path: |
LanMountainDesktop/bin/Release/
retention-days: 7
build-macos:
runs-on: macos-latest
name: Build_macOS
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: brew install portaudio
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: 'preview'
- name: Restore
run: dotnet restore ${{ env.Solution_Name }}
- name: Build
run: dotnet build ${{ env.Solution_Name }} --no-restore -c Release -v minimal
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-macos
path: |
LanMountainDesktop/bin/Release/
retention-days: 7
pack-plugin-packages:
runs-on: ubuntu-latest
name: Pack_Plugin_Packages
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: 'preview'
- name: Pack SDK and template packages
shell: pwsh
run: .\scripts\Pack-PluginPackages.ps1 -Configuration Release -OutputPath .\artifacts\nuget
- name: Upload plugin package artifacts
uses: actions/upload-artifact@v4
with:
name: plugin-packages
path: artifacts/nuget/*.nupkg
if-no-files-found: error
retention-days: 14