Skip to content

Daybreak CD Pipeline #434

Daybreak CD Pipeline

Daybreak CD Pipeline #434

Workflow file for this run

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# 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:
pull_request:
workflow_dispatch:
jobs:
# ───────────────────────────────────────────────────────
# Stage 1 — Build the x86 Windows-only components
# (Injector + API) that both platforms need.
# ───────────────────────────────────────────────────────
build-x86:
runs-on: windows-latest
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
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: Setup project secrets
run: |
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
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: Setup project secrets
run: |
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 Linux x64
run: pwsh ./Scripts/PublishLinux.ps1
shell: bash
- 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=$(ls Daybreak/*.version | head -1 | xargs basename | sed 's/\.version$//')
echo "Version=$version" >> $GITHUB_ENV
# ── Windows package ──
- name: Download Windows build
uses: actions/download-artifact@v4
with:
name: windows-build
path: windows-publish/
- name: Clean and zip Windows build
run: |
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
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: daybreakv${{ env.Version }}.zip;daybreakv${{ env.Version }}-linux.zip
github_token: ${{ env.GITHUB_TOKEN }}
replace_assets: true
body_mrkdwn: |
${{ env.Changelog }}
isDraft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}