diff --git a/.github/actions/build-project/action.yml b/.github/actions/build-project/action.yml deleted file mode 100644 index c57a6206..00000000 --- a/.github/actions/build-project/action.yml +++ /dev/null @@ -1,61 +0,0 @@ -############################################################################### -# -# Copyright 2023 Eppie(https://eppie.io) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################### - -name: Build the project - -description: Run building the project - -inputs: - project-file: - description: The project or solution file to build - required: true - type: string - - project-configuration: - description: Defines the build configuration - required: false - type: string - default: Debug - - build-properties: - description: Set or override the specified project-level properties - required: false - type: string - default: '' - - builder-type: - description: Defines which builder is used to build the project - required: false - type: choice - default: msbuild - options: - - msbuild - - dotnet - -runs: - using: "composite" - steps: - - name: Build with msbuild - if: ${{ inputs.builder-type == 'msbuild' }} - run: msbuild ${{ inputs.project-file }} -nologo -restore -verbosity:minimal -consoleLoggerParameters:Summary -property:Configuration=${{ inputs.project-configuration }} ${{ inputs.build-properties }} - shell: pwsh - - - name: Build with dotnet - if: ${{ inputs.builder-type == 'dotnet' }} - run: dotnet build ${{ inputs.project-file }} --nologo --configuration ${{ inputs.project-configuration }} ${{ inputs.build-properties }} - shell: bash diff --git a/.github/actions/build-uno-project/action.yml b/.github/actions/build-uno-project/action.yml deleted file mode 100644 index 9c9cce3b..00000000 --- a/.github/actions/build-uno-project/action.yml +++ /dev/null @@ -1,112 +0,0 @@ -############################################################################### -# -# Copyright 2023 Eppie(https://eppie.io) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################### - -name: Build the Uno project - -description: Runs building the Uno project on different platforms - -inputs: - project-map: - description: Json with project map - required: true - type: string - - configuration: - description: Defines the build configuration - required: false - type: string - default: Debug - - target: - description: Defines the build target platform - required: false - type: choice - default: default - options: - - default - - android - - gtk - - ios - - macos - - wasm - - win-x64 - - win-x86 - - win-arm64 - -runs: - using: "composite" - steps: - - name: Build with msbuild - id: build-initializer - shell: bash - run: | - case ${{ inputs.target }} in - android) - echo 'project-file=${{ fromJSON(inputs.project-map).android }}' >> $GITHUB_OUTPUT - echo 'build-properties=-property:TargetFramework=net7.0-android' >> $GITHUB_OUTPUT - echo 'builder-type=dotnet' >> $GITHUB_OUTPUT - ;; - gtk) - echo 'project-file=${{ fromJSON(inputs.project-map).gtk }}' >> $GITHUB_OUTPUT - echo 'build-properties=' >> $GITHUB_OUTPUT - echo 'builder-type=dotnet' >> $GITHUB_OUTPUT - ;; - ios) - echo 'project-file=${{ fromJSON(inputs.project-map).ios }}' >> $GITHUB_OUTPUT - echo 'build-properties=-property:TargetFramework=net7.0-ios' >> $GITHUB_OUTPUT - echo 'builder-type=dotnet' >> $GITHUB_OUTPUT - ;; - macos) - echo 'project-file=${{ fromJSON(inputs.project-map).macos }}' >> $GITHUB_OUTPUT - echo 'build-properties=-property:TargetFramework=net7.0-maccatalyst' >> $GITHUB_OUTPUT - echo 'builder-type=dotnet' >> $GITHUB_OUTPUT - ;; - wasm) - echo 'project-file=${{ fromJSON(inputs.project-map).wasm }}' >> $GITHUB_OUTPUT - echo 'build-properties=' >> $GITHUB_OUTPUT - echo 'builder-type=dotnet' >> $GITHUB_OUTPUT - ;; - win-x64) - echo 'project-file=${{ fromJSON(inputs.project-map).windows }}' >> $GITHUB_OUTPUT - echo 'build-properties=-property:Platform=x64' >> $GITHUB_OUTPUT - echo 'builder-type=msbuild' >> $GITHUB_OUTPUT - ;; - win-x86) - echo 'project-file=${{ fromJSON(inputs.project-map).windows }}' >> $GITHUB_OUTPUT - echo 'build-properties=-property:Platform=x86' >> $GITHUB_OUTPUT - echo 'builder-type=msbuild' >> $GITHUB_OUTPUT - ;; - win-arm64) - echo 'project-file=${{ fromJSON(inputs.project-map).windows }}' >> $GITHUB_OUTPUT - echo 'build-properties=-property:Platform=arm64' >> $GITHUB_OUTPUT - echo 'builder-type=msbuild' >> $GITHUB_OUTPUT - ;; - *) - echo 'project-file=${{ fromJSON(inputs.project-map).solution }}' >> $GITHUB_OUTPUT - echo 'build-properties=' >> $GITHUB_OUTPUT - echo 'builder-type=msbuild' >> $GITHUB_OUTPUT - ;; - esac - - - name: Build project - uses: ./.github/actions/build-project - with: - project-file: ${{ steps.build-initializer.outputs.project-file }} - project-configuration: ${{ inputs.configuration }} - build-properties: ${{ steps.build-initializer.outputs.build-properties }} - builder-type: ${{ steps.build-initializer.outputs.builder-type }} diff --git a/.github/actions/project-map/action.yml b/.github/actions/project-map/action.yml deleted file mode 100644 index 1f32d61b..00000000 --- a/.github/actions/project-map/action.yml +++ /dev/null @@ -1,82 +0,0 @@ -############################################################################### -# -# Copyright 2023 Eppie(https://eppie.io) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################### - -name: Project file map - -description: Sets project file map - -inputs: - solution-file: - description: Solution file path - type: string - required: true - - android-project-file: - description: Android project file path - type: string - required: true - - gtk-project-file: - description: GTK project file path - type: string - required: true - - ios-project-file: - description: iOS project file path - type: string - required: true - - macos-project-file: - description: MacOS project file path - type: string - required: true - - wasm-project-file: - description: Wasm project file path - type: string - required: true - - windows-project-file: - description: Windows project file path - type: string - required: true -outputs: - map: - value: ${{ steps.init-projects.outputs.map }} -runs: - using: "composite" - - steps: - - id: init-projects - shell: bash - run: | - map=$(cat << EOF - { - "solution":"${{ inputs.solution-file }}", - "android":"${{ inputs.android-project-file }}", - "gtk":"${{ inputs.gtk-project-file }}", - "ios":"${{ inputs.ios-project-file }}", - "macos":"${{ inputs.macos-project-file }}", - "wasm":"${{ inputs.wasm-project-file }}", - "windows":"${{ inputs.windows-project-file }}", - } - EOF - ) - echo "map<> $GITHUB_OUTPUT - echo "$map" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT diff --git a/.github/actions/setup-uno-platform/action.yml b/.github/actions/setup-uno-platform/action.yml deleted file mode 100644 index 8305de32..00000000 --- a/.github/actions/setup-uno-platform/action.yml +++ /dev/null @@ -1,74 +0,0 @@ -############################################################################### -# -# Copyright 2023 Eppie(https://eppie.io) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################### - -name: Setup the Uno Platform - -description: Sets up the Uno Platform and dependencies - -inputs: - uno-check-manifest-uri: - type: string - description: Alternative uno-check manifest file path or URL - required: false - - uno-check-version: - type: string - description: uno-check version - required: false - -runs: - using: "composite" - steps: - - id: uno-check-version-option - if: ${{ inputs.uno-check-version != null && inputs.uno-check-version != '' }} - run: echo 'cli-arg=--version ${{ inputs.uno-check-version }}' >> $GITHUB_OUTPUT - shell: bash - - - id: uno-check-manifest-option - if: ${{ inputs.uno-check-manifest-uri != null && inputs.uno-check-manifest-uri != '' }} - run: echo 'cli-arg=--manifest ${{ inputs.uno-check-manifest-uri }}' >> $GITHUB_OUTPUT - shell: bash - - - name: Update uno.check - run: dotnet tool update --global uno.check ${{ steps.uno-check-version-option.outputs.cli-arg }} --add-source https://api.nuget.org/v3/index.json - shell: bash - - - name: Download uno-check manifest - id: uno-check-manifest - uses: ./.github/actions/uno-check-manifest - with: - update-uno-check: false - uno-check-manifest-uri: ${{ inputs.uno-check-manifest-uri }} - - - name: Get .NET version (The Uno Platform requirement) - id: dotnet-uno-version - shell: bash - run: | - version="${{ fromJson(env.uno-check-manifest).check.variables.DOTNET_SDK_VERSION }}" - echo "version=$version" >> $GITHUB_OUTPUT - env: - uno-check-manifest: ${{ steps.uno-check-manifest.outputs.uno-check-manifest-json }} - - - name: Setup .NET (The Uno Platform requirement) - uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 - with: - dotnet-version: ${{ steps.dotnet-uno-version.outputs.version }} - - - name: Run uno.check - run: uno-check --verbose --ci --non-interactive --fix --target webassembly --target ios --target android --target macos --target linux --target win32 --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 --skip androidemulator ${{ steps.uno-check-manifest-option.outputs.cli-arg }} - shell: bash diff --git a/.github/actions/uno-check-manifest/action.yml b/.github/actions/uno-check-manifest/action.yml deleted file mode 100644 index cf10f840..00000000 --- a/.github/actions/uno-check-manifest/action.yml +++ /dev/null @@ -1,94 +0,0 @@ -############################################################################### -# -# Copyright 2023 Eppie(https://eppie.io) -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################### - -name: Download uno-check manifest - -description: Gets the contents of the uno-check manifest.json file - -inputs: - uno-check-manifest-uri: - type: string - description: Alternative uno-check manifest file path or URL - required: false - - update-uno-check: - type: boolean - description: update 'uno.check' dotnet tool - required: false - default: true - - uno-check-version: - type: string - description: uno-check version - required: false - -outputs: - uno-check-manifest-json: - value: ${{ steps.uno-check-manifest.outputs.manifest }} - -runs: - using: "composite" - steps: - - id: uno-check-version-option - if: ${{ inputs.update-uno-check && inputs.uno-check-version != null && inputs.uno-check-version != '' }} - shell: pwsh - run: | - "cli-arg=--version ${{ inputs.uno-check-version }}" | Write-Output >> $env:GITHUB_OUTPUT - - - name: Update uno.check - if: ${{ inputs.update-uno-check }} - shell: pwsh - run: $(dotnet tool update --global uno.check ${{ steps.uno-check-version-option.outputs.cli-arg }} --add-source https://api.nuget.org/v3/index.json) - - - name: Find uno-check manifest uri - id: uno-check-manifest-uri - shell: pwsh - run: | - $manifest_uri="${{ inputs.uno-check-manifest-uri }}" - - if ($manifest_uri) - { - "manifest-uri=$manifest_uri" | Write-Output >> $env:GITHUB_OUTPUT - } - else - { - $uno_check_output=$(uno-check --ci --non-interactive --verbose --skip all) || $("Execution of the 'uno-check' utility completed with error #$($LASTEXITCODE)." | Write-Output) - $regex="Loading Manifest from:\s*(\S+)" - - if ("$uno_check_output" -match $regex) - { - "manifest-uri=$($matches[1])" | Write-Output >> $env:GITHUB_OUTPUT - } - else - { - "manifest-uri=${{ env.main-manifest-uri }}" | Write-Output >> $env:GITHUB_OUTPUT - } - - $(exit 0) - } - env: - main-manifest-uri: https://raw.githubusercontent.com/unoplatform/uno.check/main/manifests/uno.ui.manifest.json - - - name: Download uno-check manifest - id: uno-check-manifest - shell: pwsh - run: | - $json = Invoke-WebRequest -uri '${{ env.uno-check-manifest-uri }}' | ConvertFrom-Json | ConvertTo-Json -Compress -Depth 10 - "manifest=$json" | Write-Output >> $env:GITHUB_OUTPUT - env: - uno-check-manifest-uri: ${{ steps.uno-check-manifest-uri.outputs.manifest-uri }} diff --git a/.github/configurations/build.json b/.github/configurations/build.json new file mode 100644 index 00000000..b7ee0df8 --- /dev/null +++ b/.github/configurations/build.json @@ -0,0 +1,287 @@ +[ + { + "keywords": [ + "desktop", + "windows", + "uno", + "all" + ], + "os": "windows-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-desktop", + "extra": "--verbosity=minimal --nologo" + } + }, + { + "keywords": [ + "desktop", + "linux", + "uno", + "all" + ], + "os": "ubuntu-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-desktop", + "extra": "--verbosity=minimal --nologo" + } + }, + { + "keywords": [ + "desktop", + "macos", + "uno", + "all" + ], + "os": "macos-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-desktop", + "extra": "--verbosity=minimal --nologo" + } + }, + + + { + "keywords": [ + "wasm", + "windows", + "uno", + "all" + ], + "os": "windows-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-browserwasm", + "extra": "--verbosity=minimal --nologo" + } + }, + { + "keywords": [ + "wasm", + "linux", + "uno", + "all" + ], + "os": "ubuntu-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-browserwasm", + "extra": "--verbosity=minimal --nologo" + } + }, + { + "keywords": [ + "wasm", + "macos", + "uno", + "all" + ], + "os": "macos-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-browserwasm", + "extra": "--verbosity=minimal --nologo" + } + }, + + + { + "keywords": [ + "winui", + "windows", + "uno", + "all" + ], + "os": "windows-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "true", + "uno-platform": "true" + }, + "build": { + "tool": "msbuild", + "configuration": "release", + "framework": "net8.0-windows10.0.19041", + "extra": "-verbosity:minimal -consoleLoggerParameters:Summary" + } + }, + + { + "keywords": [ + "ios", + "macos", + "uno", + "all" + ], + "os": "macos-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-ios", + "extra": "--verbosity=minimal --nologo" + } + }, + + { + "keywords": [ + "maccatalyst", + "macos", + "uno", + "all" + ], + "os": "macos-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-maccatalyst", + "extra": "--verbosity=minimal --nologo" + } + }, + + { + "keywords": [ + "android", + "windows", + "uno", + "all" + ], + "os": "windows-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-android", + "extra": "--verbosity=minimal --nologo" + } + }, + { + "keywords": [ + "android", + "linux", + "uno", + "all" + ], + "os": "ubuntu-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-android", + "extra": "--verbosity=minimal --nologo" + } + }, + { + "keywords": [ + "android", + "macos", + "uno", + "all" + ], + "os": "macos-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "framework": "net8.0-android", + "extra": "--verbosity=minimal --nologo" + } + }, + + { + "keywords": [ + "uwp", + "windows", + "autobuild", + "all" + ], + "os": "windows-latest", + "project": "./source/Eppie.App/Eppie.App.UWP/Eppie.App.UWP.csproj", + "prerequisites": { + "msbuild": "true", + "uno-platform": "false" + }, + "build": { + "tool": "msbuild", + "configuration": "release", + "framework": "uap10.0.19041", + "extra": "-verbosity:minimal -consoleLoggerParameters:Summary" + } + }, + + { + "keywords": [ + "autobuild" + ], + "os": "windows-latest", + "project": "./source/Eppie.App/Eppie.App/Eppie.App.csproj", + "prerequisites": { + "msbuild": "false", + "uno-platform": "true" + }, + "build": { + "tool": "dotnet", + "configuration": "release", + "extra": "--verbosity=minimal --nologo" + } + } +] \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3afec254..6b6ef22d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ ############################################################################### # -# Copyright 2023 Eppie(https://eppie.io) +# Copyright 2024 Eppie(https://eppie.io) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,24 +16,96 @@ # ############################################################################### +--- + name: "Build solution" -on: +on: # yamllint disable-line rule:truthy + workflow_dispatch: + inputs: + framework: + type: choice + default: all + options: + - desktop + - wasm + - winui + - ios + - macos + - android + - uwp + - all + os: + type: choice + default: all + options: + - windows + - linux + - macos + - all + push: - branches: [ "main" ] + branches: + - main + - release/** + - feature/296-upgrading-to-uno-platform-5 # temporarily pull_request: - branches: [ "main" ] - workflow_dispatch: + branches: + - main + - release/** + - feature/296-upgrading-to-uno-platform-5 # temporarily jobs: - build: - runs-on: windows-latest + prepare: + runs-on: ubuntu-latest + + outputs: + matrix: ${{ steps.build-config.outputs.matrix }} + + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + + - name: Initializing default keywords + if: github.event_name != 'workflow_dispatch' + shell: bash + run: | + echo "BUILD_CONFIG_KEYWORDS=autobuild" >> $GITHUB_ENV + + - name: Read input keywords + if: github.event_name == 'workflow_dispatch' + shell: bash + run: | + echo "BUILD_CONFIG_KEYWORDS=${{ github.event.inputs.framework }},${{ github.event.inputs.os }}" >> $GITHUB_ENV + + - name: Select configs + id: build-config + uses: finebits/github-actions/toolset/select-configuration@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0 + with: + json-file: ./.github/configurations/build.json + keywords: ${{ env.BUILD_CONFIG_KEYWORDS }} + - name: Check configs + shell: bash + run: | + length=$( echo '${{ steps.build-config.outputs.config-json }}' | jq '. | length' ) + + if(( $length == 0 )); then + echo "::error::No suitable build configuration found" + exit 1 + fi + + build: + name: ${{ matrix.os }} ${{ matrix.build.framework }} '${{ matrix.project }}' + needs: prepare strategy: - matrix: - configuration: [ Debug, Release ] - target: [ android, gtk, ios, macos, wasm, win-x64, win-x86, win-arm64 ] + fail-fast: true + matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} + + runs-on: ${{ matrix.os }} env: configuration: ${{ matrix.configuration }} @@ -41,45 +113,46 @@ jobs: dotnet-version: '8.x' - name: Eppie.App - root-dirictory: src/Eppie.App + steps: + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + with: + fetch-depth: 0 + submodules: recursive - # template: root/name/name.target/name.target.csproj - project-file-template: '{0}/{1}.{2}/{1}.{2}.csproj' + - name: Setup .NET + uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 + with: + dotnet-version: ${{ env.dotnet-version }} - steps: - - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - fetch-depth: 0 - submodules: recursive - - - name: Setup .NET - uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 - with: - dotnet-version: ${{ env.dotnet-version }} - - - name: Setup msbuild - uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 - - - name: Initialize project file paths - id: init-projects - uses: ./.github/actions/project-map - with: - solution-file: "${{ format('{0}/{1}.sln', env.root-dirictory, env.name) }}" - android-project-file: "${{ format(env.project-file-template, env.root-dirictory, env.name, 'Mobile') }}" - gtk-project-file: "${{ format(env.project-file-template, env.root-dirictory, env.name, 'Skia.Gtk') }}" - ios-project-file: "${{ format(env.project-file-template, env.root-dirictory, env.name, 'Mobile') }}" - macos-project-file: "${{ format(env.project-file-template, env.root-dirictory, env.name, 'Mobile') }}" - wasm-project-file: "${{ format(env.project-file-template, env.root-dirictory, env.name, 'Wasm') }}" - windows-project-file: "${{ format(env.project-file-template, env.root-dirictory, env.name, 'Windows') }}" - - - name: Setup the Uno Platform - uses: ./.github/actions/setup-uno-platform - - - name: Build - uses: ./.github/actions/build-uno-project - with: - project-map: ${{ steps.init-projects.outputs.map }} - configuration: ${{ env.configuration }} - target: ${{ env.target }} + - name: Setup msbuild + if: matrix.prerequisites.msbuild == 'true' + uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0 + + - name: Setup the Uno Platform + if: matrix.prerequisites.uno-platform == 'true' + uses: finebits/github-actions/devhub/uno-platform/setup@4a126d80a11c5fdc83ce884d3d23dffb30bc4495 # v2.0.0 + + - name: Build via dotnet + if: matrix.build.tool == 'dotnet' + shell: bash + run: | + project='${{ matrix.project }}' + configuration='${{ matrix.build.configuration }}' + extra_options='${{ matrix.build.extra }}' + framework='${{ matrix.build.framework }}' + framework_option=$([ "$framework" != "" ] && echo "--framework=$framework" || echo "") + + dotnet build --configuration=$configuration $framework_option $extra_options $project + + - name: Build via msbuild + if: matrix.build.tool == 'msbuild' && runner.os == 'Windows' + shell: pwsh + run: | + $project='${{ matrix.project }}' + $configuration='${{ matrix.build.configuration }}' + $extra_options=$('${{ matrix.build.extra }}' -split '\s+') + $framework='${{ matrix.build.framework }}' + $framework_option=$( if($framework) {"-property:TargetFramwork=$framework"} else {""} ) + + msbuild -target:Rebuild -restore:True -property:Configuration=$configuration $framework_option $extra_options $project