Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
228 changes: 178 additions & 50 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

# This continuous integration pipeline is triggered anytime a user pushes code to the repo.
# This pipeline builds the Wpf project, runs unit tests, then saves the MSIX build artifact.
name: Daybreak CD Pipeline
# This continuous delivery pipeline is triggered on pushes to master.
# It builds the Windows x86 components (Injector + API), then builds
# the Windows x64 and Linux x64 platform bundles in parallel, and
# finally packages both into release zips and publishes a GitHub release.
name: Daybreak CD Pipeline

on:
push:
Expand All @@ -17,22 +19,54 @@ on:
- "Daybreak.Installer/**"
- "Daybreak.Shared/**"
workflow_dispatch:

jobs:

build:
# ───────────────────────────────────────────────────────
# Stage 1 — Build the x86 Windows-only components
# (Injector + API) that both platforms need.
# ───────────────────────────────────────────────────────
build-x86:
runs-on: windows-latest

strategy:
matrix:
targetplatform: [x64]
env:
Configuration: Release
Actions_Allow_Unsecure_Commands: true

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive

- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'

- name: Publish x86 components
run: .\Scripts\PublishWindowsX86.ps1
shell: pwsh

- name: Upload x86 artifacts
uses: actions/upload-artifact@v4
with:
name: x86-components
path: |
Publish/Injector/
Publish/Api/
retention-days: 1

# ───────────────────────────────────────────────────────
# Stage 2 — Platform builds (parallel)
# ───────────────────────────────────────────────────────
build-windows:
needs: build-x86
runs-on: windows-latest

env:
Configuration: Release
Solution_Path: Daybreak.slnx
Test_Project_Path: Daybreak.Tests\Daybreak.Tests.csproj
Wpf_Project_Path: Daybreak\Daybreak.csproj
Actions_Allow_Unsecure_Commands: true

steps:
Expand All @@ -42,64 +76,161 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Get Latest Tag
id: getLatestTag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'

- name: Generate changelog
id: gen_changelog
- name: Setup project secrets
run: |
$changeLog = git log --no-merges --pretty="%h - %s (%an)<br />" ${{ env.LatestReleaseTag }}..HEAD
echo "::set-env name=Changelog::$changeLog"
mkdir Publish
echo $changeLog > .\Publish\changelog.txt
env:
LatestReleaseTag: ${{steps.getLatestTag.outputs.tag}}
dotnet user-secrets --project Daybreak.Core\Daybreak.Core.csproj set AadApplicationId "${{ secrets.AadApplicationId }}"
dotnet user-secrets --project Daybreak.Core\Daybreak.Core.csproj set AadTenantId "${{ secrets.AadTenantId }}"
dotnet user-secrets --project Daybreak.Core\Daybreak.Core.csproj set ApmServiceAccount "${{ secrets.ApmServiceAccount }}"
dotnet user-secrets --project Daybreak.Core\Daybreak.Core.csproj set ApmServiceKey "${{ secrets.ApmServiceKey }}"
dotnet user-secrets --project Daybreak.Core\Daybreak.Core.csproj set ApmUri "${{ secrets.ApmUri }}"

- name: Download x86 artifacts
uses: actions/download-artifact@v4
with:
name: x86-components
path: Publish/

- name: Publish Windows x64
run: .\Scripts\PublishWindows.ps1
shell: pwsh

- name: Upload Windows build
uses: actions/upload-artifact@v4
with:
name: windows-build
path: Publish/
retention-days: 1

build-linux:
needs: build-x86
runs-on: ubuntu-latest

env:
Configuration: Release

- name: Install .NET Core
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive

- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
architecture: x64

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2.0.0

- name: Setup project secrets
run: |
dotnet user-secrets --project Daybreak\Daybreak.csproj set AadApplicationId "${{ secrets.AadApplicationId }}"
dotnet user-secrets --project Daybreak\Daybreak.csproj set AadTenantId "${{ secrets.AadTenantId }}"
dotnet user-secrets --project Daybreak\Daybreak.csproj set ApmServiceAccount "${{ secrets.ApmServiceAccount }}"
dotnet user-secrets --project Daybreak\Daybreak.csproj set ApmServiceKey "${{ secrets.ApmServiceKey }}"
dotnet user-secrets --project Daybreak\Daybreak.csproj set ApmUri "${{ secrets.ApmUri }}"
dotnet user-secrets --project Daybreak.Core/Daybreak.Core.csproj set AadApplicationId "${{ secrets.AadApplicationId }}"
dotnet user-secrets --project Daybreak.Core/Daybreak.Core.csproj set AadTenantId "${{ secrets.AadTenantId }}"
dotnet user-secrets --project Daybreak.Core/Daybreak.Core.csproj set ApmServiceAccount "${{ secrets.ApmServiceAccount }}"
dotnet user-secrets --project Daybreak.Core/Daybreak.Core.csproj set ApmServiceKey "${{ secrets.ApmServiceKey }}"
dotnet user-secrets --project Daybreak.Core/Daybreak.Core.csproj set ApmUri "${{ secrets.ApmUri }}"
- name: Download x86 artifacts
uses: actions/download-artifact@v4
with:
name: x86-components
path: Publish/

- name: Restore project
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration --property:SolutionDir=$GITHUB_WORKSPACE
- name: Publish Linux x64
run: pwsh ./Scripts/PublishLinux.ps1
shell: bash

- name: Build Daybreak project
run: dotnet build Daybreak -c $env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE
- name: Set executable permissions
run: |
chmod +x Publish/Daybreak
chmod +x Publish/Daybreak.Wayland.sh

- name: Upload Linux build
uses: actions/upload-artifact@v4
with:
name: linux-build
path: Publish/
retention-days: 1

# ───────────────────────────────────────────────────────
# Stage 3 — Package and release
# ───────────────────────────────────────────────────────
release:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest

env:
Actions_Allow_Unsecure_Commands: true

steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive

- name: Get Latest Tag
id: getLatestTag
uses: WyriHaximus/github-action-get-previous-tag@v1

- name: Generate changelog
id: gen_changelog
run: |
changeLog=$(git log --no-merges --pretty="%h - %s (%an)<br />" ${{ steps.getLatestTag.outputs.tag }}..HEAD)
echo "Changelog<<EOF" >> $GITHUB_ENV
echo "$changeLog" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Set version variable
run: |
$version = .\Scripts\GetBuildVersion.ps1
echo "::set-env name=Version::$version"
version=$(grep '<Version>' Directory.Build.props | sed 's/.*<Version>\(.*\)<\/Version>.*/\1/')
echo "Version=$version" >> $GITHUB_ENV

- name: Create publish launcher files
run: dotnet publish .\Daybreak\Daybreak.csproj -c $env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE -p:PublishReadyToRun=true -p:PublishSingleFile=false --self-contained true -o .\Publish
# ── Windows package ──
- name: Download Windows build
uses: actions/download-artifact@v4
with:
name: windows-build
path: windows-publish/

- name: Pack publish files
- name: Clean and zip Windows build
run: |
Write-Host $env
.\Scripts\BuildRelease.ps1 -version $env:Version
shell: pwsh
cd windows-publish
find . -name '*.pdb' -delete
if [ -f Installer/Daybreak.Installer.exe ]; then
mv Installer/Daybreak.Installer.exe Installer/Daybreak.Installer.Temp.exe
fi
cd ..
cd windows-publish && zip -r ../daybreakv${{ env.Version }}.zip . && cd ..

# ── Linux package ──
- name: Download Linux build
uses: actions/download-artifact@v4
with:
name: linux-build
path: linux-publish/

- name: Clean and zip Linux build
run: |
cd linux-publish
find . -name '*.pdb' -delete
if [ -f Installer/Daybreak.Installer ]; then
mv Installer/Daybreak.Installer Installer/Daybreak.Installer.Temp
fi
chmod +x Daybreak Daybreak.Wayland.sh
cd ..
cd linux-publish && zip -r ../daybreakv${{ env.Version }}-linux.zip . && cd ..

# ── Release ──
- name: Create release draft
uses: Xotl/cool-github-releases@v1.1.10
with:
mode: update
tag_name: v${{ env.Version }}
release_name: Daybreak v${{ env.Version }}
assets: .\Publish\daybreakv${{ env.Version }}.zip
assets: daybreakv${{ env.Version }}.zip;daybreakv${{ env.Version }}-linux.zip
github_token: ${{ env.GITHUB_TOKEN }}
replace_assets: true
body_mrkdwn: |
Expand All @@ -109,9 +240,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish release
run: |
gh release edit v${{ env.Version }} --draft=false
shell: powershell
run: gh release edit v${{ env.Version }} --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 42 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.

# This continuous integration pipeline is triggered anytime a user pushes code to the repo.
# This pipeline builds the Wpf project, runs unit tests, then saves the MSIX build artifact.
name: Daybreak CI Pipeline
# This continuous integration pipeline is triggered on pull requests to master.
# It validates that both the Windows and Linux builds compile successfully.
name: Daybreak CI Pipeline

on:
pull_request:
Expand All @@ -12,19 +12,44 @@ on:

jobs:

build:
build-windows:
runs-on: windows-latest

strategy:
matrix:
targetplatform: [x64]
env:
Configuration: Debug

runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive

- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'

- name: Build Windows project
run: dotnet build Daybreak.Windows/Daybreak.Windows.csproj -c $env:Configuration

- name: Build Injector
run: dotnet build Daybreak.Injector/Daybreak.Injector.csproj -c $env:Configuration

- name: Build API
run: dotnet build Daybreak.API/Daybreak.API.csproj -c $env:Configuration

- name: Build Installer
run: dotnet build Daybreak.Installer/Daybreak.Installer.csproj -c $env:Configuration

- name: Run tests
run: dotnet test Daybreak.Tests/Daybreak.Tests.csproj -c $env:Configuration

build-linux:
runs-on: ubuntu-latest

env:
Solution_Path: Daybreak.slnx
Test_Project_Path: Daybreak.Tests\Daybreak.Tests.csproj
Wpf_Project_Path: Daybreak\Daybreak.csproj
Actions_Allow_Unsecure_Commands: true
Configuration: Debug

steps:
- name: Checkout
Expand All @@ -33,16 +58,13 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Install .NET Core
- name: Install .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
architecture: x64

- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2.0.0
- name: Build Linux project
run: dotnet build Daybreak.Linux/Daybreak.Linux.csproj -c $Configuration

- name: Restore the Wpf application to populate the obj folder
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE
env:
Configuration: Debug
- name: Build Installer (linux-x64)
run: dotnet build Daybreak.Installer/Daybreak.Installer.csproj -c $Configuration
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
Configuration: Release
Solution_Path: Daybreak.slnx
Test_Project_Path: Daybreak.Tests\Daybreak.Tests.csproj
Wpf_Project_Path: Daybreak\Daybreak.csproj
Wpf_Project_Path: Daybreak.Windows\Daybreak.Windows.csproj
Actions_Allow_Unsecure_Commands: true

steps:
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Build Daybreak project
run: dotnet build Daybreak -c $env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE
run: dotnet build Daybreak.Windows -c $env:Configuration --property:SolutionDir=$env:GITHUB_WORKSPACE

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Loading
Loading