refactor: move UI tools to Eppie.App.UI #942
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# | |
# 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. | |
# 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 solution" | |
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 | |
- release/** | |
- feature/296-upgrading-to-uno-platform-5 # temporarily | |
pull_request: | |
branches: | |
- main | |
- release/** | |
- feature/296-upgrading-to-uno-platform-5 # temporarily | |
jobs: | |
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.build.framework }} ${{ matrix.os }} '${{ matrix.build.project }}' | |
needs: prepare | |
strategy: | |
fail-fast: true | |
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} | |
runs-on: ${{ matrix.os }} | |
env: | |
configuration: ${{ matrix.configuration }} | |
target: ${{ matrix.target }} | |
dotnet-version: '8.x' | |
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 | |
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: 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.build.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.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:Build -property:Configuration=$configuration $framework_option $extra_options $project |