Skip to content

Split building workflows #84

Split building workflows

Split building workflows #84

name: 'Build launcher'
on:
push:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'src/**'
- '*.sln'
- '*.config'
- '*.props'
- '*.targets'
pull_request:
branches:
- '**'
paths:
- '.github/workflows/**'
- 'src/**'
- '*.sln'
- '*.config'
- '*.props'
- '*.targets'
defaults:
run:
shell: pwsh
jobs:
build-launcher-avalonia:
name: 'Build launcher Avalonia'
strategy:
matrix:
system:
- windows-2022
config:
- Debug
- Release
runs-on: ${{ matrix.system }}
env:
LauncherProject: src\ImeSense.Launchers.Belarus.Avalonia\ImeSense.Launchers.Belarus.Avalonia.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Restore dependencies
run: |
dotnet restore $env:LauncherProject
- name: Build launcher
run: |
dotnet build $env:LauncherProject `
--configuration ${{ matrix.config }} `
--no-restore
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: launcher-avalonia-net7.0-${{ matrix.config }}-${{ github.sha }}
path: bin/${{ matrix.config }}/
build-launcher-wpf:
name: 'Build launcher WPF'
strategy:
matrix:
system:
- windows-2022
config:
- Debug
- Release
runs-on: ${{ matrix.system }}
env:
LauncherProject: src\ImeSense.Launchers.Belarus.Legacy\ImeSense.Launchers.Belarus.Legacy.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Restore dependencies
run: |
dotnet restore $env:LauncherProject
- name: Build launcher
run: |
dotnet build $env:LauncherProject `
--configuration ${{ matrix.config }} `
--no-restore
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: launcher-wpf-net7.0-${{ matrix.config }}-${{ github.sha }}
path: bin/${{ matrix.config }}/
build-updater-cli:
name: 'Build updater CLI'
strategy:
matrix:
system:
- windows-2022
config:
- Debug
- Release
runs-on: ${{ matrix.system }}
env:
UpdaterProject: src\ImeSense.Launchers.Belarus.Updater\ImeSense.Launchers.Belarus.Updater.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Restore dependencies
run: |
dotnet restore $env:UpdaterProject
- name: Build launcher
run: |
dotnet build $env:UpdaterProject `
--configuration ${{ matrix.config }} `
--no-restore
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: updater-cli-net7.0-${{ matrix.config }}-${{ github.sha }}
path: bin/${{ matrix.config }}/
publish:
name: 'Publish'
strategy:
matrix:
system:
- windows-2022
config:
- Release
runtime:
- win-x86
- win-x64
runs-on: ${{ matrix.system }}
env:
LauncherProject: src\ImeSense.Launchers.Belarus.Avalonia\ImeSense.Launchers.Belarus.Avalonia.csproj
UpdaterProject: src\ImeSense.Launchers.Belarus.Updater\ImeSense.Launchers.Belarus.Updater.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'
- name: Publish launcher
run: |
dotnet publish $env:LauncherProject `
--configuration ${{ matrix.config }} `
--runtime ${{ matrix.runtime }} `
--self-contained true `
-p:PublishSingleFile=true `
-p:IncludeAllContentForSelfExtract=true `
-p:EnableCompressionInSingleFile=true `
-p:DebugSymbols=false `
-p:DebugType=None
- name: Publish updater
run: |
dotnet publish $env:UpdaterProject `
--configuration ${{ matrix.config }} `
--runtime ${{ matrix.runtime }} `
--self-contained true `
-p:PublishSingleFile=true `
-p:IncludeAllContentForSelfExtract=true `
-p:EnableCompressionInSingleFile=true `
-p:DebugSymbols=false `
-p:DebugType=None
- name: Publish installer
if: matrix.runtime == 'win-x86'
shell: cmd
run: |
"%ProgramFiles(x86)%\Inno Setup 6\iscc.exe" src\ImeSense.Launchers.Belarus.Setup\Setup.iss
- name: Upload launcher
uses: actions/upload-artifact@v4
with:
name: sblauncher-${{ matrix.runtime }}-${{ github.sha }}
path: bin/Release/${{ matrix.runtime }}/publish/
- name: Upload installer
uses: actions/upload-artifact@v4
if: matrix.runtime == 'win-x86'
with:
name: sbinstaller-${{ github.sha }}
path: bin/SBLauncherInstaller.exe