Skip to content

Commit

Permalink
ci-cd: Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
roxk committed Mar 29, 2024
1 parent 58d2dc3 commit 4cb50ab
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@ on:
jobs:
test:
runs-on: windows-2022
if: startsWith(github.ref, 'refs/tags/vs2022-v') == false
if: ${{ !startsWith(github.ref, 'refs/tags/vs2022-v') && !startsWith(github.ref, 'refs/tags/v') }}
steps:
- uses: actions/checkout@v3
- working-directory: WinUI3XamlPreview
run: ./scripts/ci
no-build-test:
runs-on: windows-2022
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- working-directory: WinUI3XamlPreview
run: ./scripts/format -check
build:
runs-on: windows-2022
needs: ["test"]
needs: ["no-build-test"]
if: startsWith(github.ref, 'refs/tags/v')
env:
VERSION: 0.1.0
Expand All @@ -29,7 +36,7 @@ jobs:
- uses: actions/checkout@v3
- working-directory: WinUI3XamlPreview
run: |
./scripts/build -version $env:VERSION
./scripts/build-nuget -version $env:VERSION
./scripts/publish-nuget -version $env:VERSION
build-extension:
runs-on: windows-2022
Expand Down
6 changes: 5 additions & 1 deletion WinUI3XamlPreview/WinUI3XamlPreviewCs/Directory.Build.Props
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<BuildOutDir>$([MSBuild]::NormalizeDirectory('$(SolutionDir)', '$(Platform)', '$(Configuration)'))</BuildOutDir>
<!-- When building from CLI, even if we specify solution solution dir would be empty -->
<!-- And ProjectDir somehow points to solution dir instead so we use that -->
<!-- But, if we only use project dir, for some reason building in VS project dir would be empty -->
<!-- ¯\_(ツ)_/¯ -->
<BuildOutDir>$(SolutionDir)$(Platform)\$(Configuration)</BuildOutDir>
<OutDir>$([MSBuild]::NormalizeDirectory('$(BuildOutDir)', '$(MSBuildProjectName)', 'bin'))</OutDir>
<IntDir>$([MSBuild]::NormalizeDirectory('$(BuildOutDir)', '$(MSBuildProjectName)', 'obj'))</IntDir>
</PropertyGroup>
Expand Down
3 changes: 2 additions & 1 deletion WinUI3XamlPreview/scripts/build-nuget.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ $template = Get-Content $PSScriptRoot\..\Nuget\WinUI3XamlPreview.nuspec.template
$nuspec = $template.Replace("VERSION", $version)
Set-Content -path $PSScriptRoot\..\Nuget\.nuspec -value $nuspec
. "$PSScriptRoot\get-msbuild"
nuget restore $PSScriptRoot\..\WinUI3XamlPreviewCs\WinUI3XamlPreviewCs.csproj
nuget restore $PSScriptRoot\..\WinUI3XamlPreview\WinUI3XamlPreview.vcxproj -PackagesDirectory $PSScriptRoot\..\packages
&$msbuild $PSScriptRoot\.. -t:WinUI3XamlPreview -p:Platform=x64,Configuration=Release
&$msbuild $PSScriptRoot\.. -t:WinUI3XamlPreviewCs -p:Platform=x64,Configuration=Release
&$msbuild $PSScriptRoot\.. -t:WinUI3XamlPreviewCs "-p:Platform=Any CPU",Configuration=Release
# TODO: Fix ARM support. idlgen is attempting to use ARM64/idlgen.exe when the host is x64.
#&$msbuild $PSScriptRoot\..\WinUI3XamlPreview\WinUI3XamlPreview.vcxproj -p:Platform=ARM64,Configuration=Release
nuget pack $PSScriptRoot\..\Nuget\.nuspec -outputDirectory $PSScriptRoot\..\Nuget

0 comments on commit 4cb50ab

Please sign in to comment.