Skip to content

Add the Studio v2 timeline and multi-clip editing on macOS #1461

Add the Studio v2 timeline and multi-clip editing on macOS

Add the Studio v2 timeline and multi-clip editing on macOS #1461

Workflow file for this run

name: Windows Build
on:
pull_request:
branches: [main, develop]
push:
branches: [main, develop]
workflow_dispatch:
concurrency:
# Manual runs share the selected branch's push group; PRs keep their own group.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Detect Windows changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
# A superseding push must validate code from earlier cancelled pushes too.
windows: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || steps.filter.outputs.windows }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Filter changed files
id: filter
if: ${{ github.event_name != 'push' }}
uses: dorny/paths-filter@v4
with:
predicate-quantifier: some-with-excludes
filters: |
windows:
- 'windows/src/**'
- 'windows/tests/**'
- 'windows/*.props'
- 'windows/*.targets'
- 'windows/*.sln'
- 'windows/*.slnx'
- 'windows/packaging/Assert-DirectPackage.ps1'
- 'shared/studio/fixtures/**'
- 'shared/automation/**'
- 'global.json'
- '[Nn]u[Gg]et.[Cc]onfig'
- 'Directory.Build.props'
- 'Directory.Build.targets'
- 'Directory.Packages.props'
- 'shared/screenshot/fixtures/**'
- '.github/workflows/windows-build.yml'
- '!**/*.md'
base: ${{ github.ref }}
build:
name: Build (Windows, ${{ matrix.platform }})
needs: changes
if: ${{ !cancelled() }}
runs-on: ${{ needs.changes.result == 'success' && needs.changes.outputs.windows == 'true' && 'windows-latest' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
include:
- platform: x64
rid: win-x64
architecture: x64
- platform: ARM64
rid: win-arm64
architecture: arm64
steps:
- name: Validate build decision
shell: bash
env:
CHANGES_RESULT: ${{ needs.changes.result }}
WINDOWS_CHANGED: ${{ needs.changes.outputs.windows }}
run: |
if [ "$CHANGES_RESULT" != "success" ]; then
echo "::error::Windows change detection did not succeed ($CHANGES_RESULT)."
exit 1
fi
case "$WINDOWS_CHANGED" in
true) echo "Windows changes detected; building the direct package." ;;
false) echo "No Windows files changed; skipping the direct package build." ;;
*) echo "::error::Invalid Windows change detection output: $WINDOWS_CHANGED"; exit 1 ;;
esac
- name: Checkout code
if: ${{ needs.changes.outputs.windows == 'true' }}
uses: actions/checkout@v6
- name: Place NuGet caches in runner temp
if: needs.changes.outputs.windows == 'true' && runner.os == 'Windows' && runner.environment == 'github-hosted'
shell: pwsh
run: |
$packages = Join-Path $env:RUNNER_TEMP 'nuget\packages'
$httpCache = Join-Path $env:RUNNER_TEMP 'nuget\http-cache'
New-Item -ItemType Directory -Force -Path $packages, $httpCache | Out-Null
"NUGET_PACKAGES=$packages" >> $env:GITHUB_ENV
"NUGET_HTTP_CACHE_PATH=$httpCache" >> $env:GITHUB_ENV
- name: Setup .NET SDK
if: ${{ needs.changes.outputs.windows == 'true' }}
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Restore direct app for ${{ matrix.platform }}
if: ${{ needs.changes.outputs.windows == 'true' }}
run: >-
dotnet restore windows/src/TinyClips.App/TinyClips.App.csproj
-p:Configuration=Release
-p:Platform=${{ matrix.platform }}
-p:RuntimeIdentifier=${{ matrix.rid }}
-p:TinyClipsDirectReleaseBuild=true
- name: Build and inspect direct package for ${{ matrix.platform }}
if: ${{ needs.changes.outputs.windows == 'true' }}
shell: pwsh
run: |
$packageDirectory = Join-Path (Resolve-Path ".") "artifacts/direct-${{ matrix.architecture }}/"
New-Item -ItemType Directory -Force $packageDirectory | Out-Null
dotnet build windows/src/TinyClips.App/TinyClips.App.csproj `
-c Release `
-p:Platform=${{ matrix.platform }} `
-p:RuntimeIdentifier=${{ matrix.rid }} `
-p:TinyClipsDirectReleaseBuild=true `
-p:EnableMsixTooling=true `
-p:GenerateAppxPackageOnBuild=true `
-p:AppxPackageDir=$packageDirectory `
-p:AppxBundle=Never `
-p:UapAppxPackageBuildMode=SideloadOnly `
-p:AppxPackageSigningEnabled=false `
-p:AppxSymbolPackageEnabled=false `
--no-restore `
-v:minimal
if ($LASTEXITCODE -ne 0) { throw "Direct package build failed." }
$msix = Get-ChildItem $packageDirectory -Recurse -Filter *.msix |
Where-Object { $_.Name -notmatch "symbols" } |
Select-Object -First 1
if (-not $msix) { throw "Direct package build produced no MSIX." }
& windows/packaging/Assert-DirectPackage.ps1 `
-MsixPath $msix.FullName `
-Architecture ${{ matrix.architecture }}
store-build:
name: Build Microsoft Store flavor
needs: changes
if: ${{ needs.changes.outputs.windows == 'true' }}
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Place NuGet caches in runner temp
if: runner.os == 'Windows' && runner.environment == 'github-hosted'
shell: pwsh
run: |
$packages = Join-Path $env:RUNNER_TEMP 'nuget\packages'
$httpCache = Join-Path $env:RUNNER_TEMP 'nuget\http-cache'
New-Item -ItemType Directory -Force -Path $packages, $httpCache | Out-Null
"NUGET_PACKAGES=$packages" >> $env:GITHUB_ENV
"NUGET_HTTP_CACHE_PATH=$httpCache" >> $env:GITHUB_ENV
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Build framework-dependent Store flavor
run: >-
dotnet build windows/src/TinyClips.App/TinyClips.App.csproj
-c Release
-p:Platform=x64
-p:TinyClipsStoreBuild=true
-p:TinyClipsDirectReleaseBuild=false
-p:PublishAot=false
-p:SelfContained=false
-p:WindowsAppSDKSelfContained=false
-p:PublishTrimmed=false
-v:minimal
test:
name: Run Core Tests
runs-on: windows-latest
needs: [changes, build, store-build]
if: ${{ needs.changes.outputs.windows == 'true' }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Place NuGet caches in runner temp
if: runner.os == 'Windows' && runner.environment == 'github-hosted'
shell: pwsh
run: |
$packages = Join-Path $env:RUNNER_TEMP 'nuget\packages'
$httpCache = Join-Path $env:RUNNER_TEMP 'nuget\http-cache'
New-Item -ItemType Directory -Force -Path $packages, $httpCache | Out-Null
"NUGET_PACKAGES=$packages" >> $env:GITHUB_ENV
"NUGET_HTTP_CACHE_PATH=$httpCache" >> $env:GITHUB_ENV
- name: Setup .NET SDK
id: dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Cache NuGet packages
uses: actions/cache@v5
with:
path: ${{ env.NUGET_PACKAGES }}
key: nuget-v2-${{ runner.os }}-${{ runner.arch }}-tests-win-x64-sdk-${{ steps.dotnet.outputs.dotnet-version }}-${{ hashFiles('global.json', 'windows/**/*.csproj', 'windows/**/*.props', 'windows/**/*.targets', 'windows/**/*.pubxml', 'windows/**/packages.lock.json', '**/[Nn]u[Gg]et.[Cc]onfig') }}
- name: Restore test project
run: dotnet restore windows/tests/TinyClips.Core.Tests/TinyClips.Core.Tests.csproj
- name: Run tests
run: dotnet test windows/tests/TinyClips.Core.Tests/TinyClips.Core.Tests.csproj -c Release --no-restore
- name: Restore Settings view-model tests
run: dotnet restore windows/tests/TinyClips.App.Tests/TinyClips.App.Tests.csproj -p:Platform=x64
- name: Run Settings view-model tests
run: dotnet test windows/tests/TinyClips.App.Tests/TinyClips.App.Tests.csproj -c Release -p:Platform=x64 --no-restore
no-windows-changes:
name: Build skipped (no Windows changes)
needs: changes
if: ${{ needs.changes.outputs.windows != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Report successful skip
run: echo "No Windows files changed; skipping the Windows build and tests."