Skip to content

Commit

Permalink
ci: fix build workflow (#363)
Browse files Browse the repository at this point in the history
* ci: fix build workflow

Fix TargetFramework 'net8.0-windows10.0.19041'.

References: #332

* ci: fix build workflow

Add 'Restore' command

References: #332

* ci: fix build workflow

Disable the 'Restore' command when building with dotnet

References: #332

* ci: fix build workflow

Fix msbuild for 'net8.0-maccatalyst/maccatalyst-arm64'.

References: #332
  • Loading branch information
al-kau authored Oct 2, 2024
1 parent e0ca7a6 commit 3d14a6d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 22 deletions.
46 changes: 28 additions & 18 deletions .github/configurations/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"all"
],
"os": "windows-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-desktop",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -27,13 +27,13 @@
"all"
],
"os": "ubuntu-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-desktop",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -47,13 +47,13 @@
"all"
],
"os": "macos-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-desktop",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -69,13 +69,13 @@
"all"
],
"os": "windows-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-browserwasm",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -89,13 +89,13 @@
"all"
],
"os": "ubuntu-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-browserwasm",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -109,13 +109,13 @@
"all"
],
"os": "macos-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-browserwasm",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -131,16 +131,21 @@
"all"
],
"os": "windows-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"msbuild": "true",
"uno-platform": "true"
},
"restore": {
"tool": "msbuild",
"project": "./source/Eppie.App/Eppie.App.sln",
"extra": "-verbosity:minimal -consoleLoggerParameters:Summary"
},
"build": {
"tool": "dotnet",
"tool": "msbuild",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-windows10.0.19041",
"extra": "--verbosity=minimal --nologo"
"extra": "-verbosity:minimal -consoleLoggerParameters:Summary"
}
},

Expand All @@ -152,13 +157,13 @@
"all"
],
"os": "macos-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-ios",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -173,13 +178,13 @@
"all"
],
"os": "macos-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-maccatalyst",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -194,13 +199,13 @@
"all"
],
"os": "windows-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-android",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -214,13 +219,13 @@
"all"
],
"os": "ubuntu-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-android",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -234,13 +239,13 @@
"all"
],
"os": "macos-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "false",
"uno-platform": "true"
},
"build": {
"tool": "dotnet",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"framework": "net8.0-android",
"extra": "--verbosity=minimal --nologo"
Expand All @@ -255,13 +260,18 @@
"all"
],
"os": "windows-latest",
"project": "./source/Eppie.App/Eppie.App.UWP/Eppie.App.UWP.csproj",
"prerequisites": {
"msbuild": "true",
"uno-platform": "false"
},
"restore": {
"tool": "msbuild",
"project": "./source/Eppie.App/Eppie.App.sln",
"extra": "-verbosity:minimal -consoleLoggerParameters:Summary"
},
"build": {
"tool": "msbuild",
"project": "./source/Eppie.App/Eppie.App.UWP/Eppie.App.UWP.csproj",
"configuration": "release",
"extra": "-verbosity:minimal -consoleLoggerParameters:Summary"
}
Expand All @@ -272,15 +282,15 @@
"autobuild"
],
"os": "windows-latest",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"prerequisites": {
"msbuild": "true",
"uno-platform": "true"
},
"build": {
"tool": "msbuild",
"project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj",
"configuration": "release",
"extra": "-verbosity:minimal -consoleLoggerParameters:Summary"
"extra": "-restore:True -verbosity:minimal -consoleLoggerParameters:Summary"
}
}
]
26 changes: 22 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
fi
build:
name: ${{ matrix.build.framework }} ${{ matrix.os }} '${{ matrix.project }}'
name: ${{ matrix.build.framework }} ${{ matrix.os }} '${{ matrix.build.project }}'
needs: prepare
strategy:
fail-fast: true
Expand Down Expand Up @@ -133,11 +133,29 @@ jobs:
if: matrix.prerequisites.uno-platform == 'true'
uses: finebits/github-actions/devhub/uno-platform/setup@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0

- name: Restore via dotnet
if: matrix.restore.tool == 'dotnet'
shell: bash
run: |
project='${{ matrix.restore.project }}'
extra_options='${{ matrix.restore.extra }}'
dotnet restore $extra_options $project
- name: Restore via msbuild
if: matrix.restore.tool == 'msbuild' && runner.os == 'Windows'
shell: pwsh
run: |
$project='${{ matrix.restore.project }}'
$extra_options=$('${{ matrix.restore.extra }}' -split '\s+')
msbuild -target:Restore $extra_options $project
- name: Build via dotnet
if: matrix.build.tool == 'dotnet'
shell: bash
run: |
project='${{ matrix.project }}'
project='${{ matrix.build.project }}'
configuration='${{ matrix.build.configuration }}'
extra_options='${{ matrix.build.extra }}'
framework='${{ matrix.build.framework }}'
Expand All @@ -149,10 +167,10 @@ jobs:
if: matrix.build.tool == 'msbuild' && runner.os == 'Windows'
shell: pwsh
run: |
$project='${{ matrix.project }}'
$project='${{ matrix.build.project }}'
$configuration='${{ matrix.build.configuration }}'
$extra_options=$('${{ matrix.build.extra }}' -split '\s+')
$framework='${{ matrix.build.framework }}'
$framework_option=$( if($framework) {"-property:TargetFramework=$framework"} else {""} )
msbuild -target:Rebuild -restore:True -property:Configuration=$configuration $framework_option $extra_options $project
msbuild -target:Build -property:Configuration=$configuration $framework_option $extra_options $project

0 comments on commit 3d14a6d

Please sign in to comment.