Skip to content

March2024 updates (#143) #128

March2024 updates (#143)

March2024 updates (#143) #128

name: Build Xamarin.Forms Applications
on:
workflow_dispatch:
push:
branches:
- main
- "xamarin/*"
paths:
- 'src/Xamarin/**/*'
- '.github/workflows/main_build-xamarin.yml'
env:
FORMS_PROJECT_PATH: "src/Xamarin/XamForms/Portable/XamForms.Portable.csproj"
ANDROID_PROJECT_PATH: "src/Xamarin/XamForms/Portable/XamForms.Portable.csproj"
iOS_PROJECT_PATH: "src/Xamarin/XamForms/Portable/XamForms.Portable.csproj"
UWP_PROJECT_PATH: "src/Xamarin/XamForms/UWP/XamForms.UWP.csproj"
NUGETCONFIG_PATH: "src/NuGet.Config"
TELERIK_USERNAME: ${{ secrets.MyTelerikAccountUsername }} # used by the NuGet.Config file
TELERIK_PASSWORD: ${{ secrets.MyTelerikAccountPassword }} # used by the NuGet.Config file
jobs:
# UWP project build
windows-build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate version number
shell: pwsh
run: |
$buildDay = Get-Date -Format "yyyy.Mdd"
$ver = $buildDay + "." + $env:GITHUB_RUN_NUMBER + ".0"
echo "APP_VERSION=$ver" >> $GITHUB_ENV
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.2
- name: Setup Nuget.exe
uses: nuget/setup-nuget@v2
- name: NuGet Restore - Class Library Project
run: nuget restore ${{ env.FORMS_PROJECT_PATH }} -ConfigFile ${{ env.NUGETCONFIG_PATH }}
- name: NuGet Restore - Platform Project
run: nuget restore ${{ env.UWP_PROJECT_PATH }} -ConfigFile ${{ env.NUGETCONFIG_PATH }}
- name: Build UWP Project
run: msbuild ${{ env.UWP_PROJECT_PATH }} /p:Platform=x64 /p:Configuration=Debug /p:AppxPackageSigningEnabled=false
# - name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: UWP Artifacts
# path: src\Xamarin\XamForms\UWP\bin
# Xamarin.Android project build
android-build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate version number
shell: pwsh
run: |
$buildDay = Get-Date -Format "yyyy.Mdd"
$ver = $buildDay + "." + $env:GITHUB_RUN_NUMBER + ".0"
echo "APP_VERSION=$ver" >> $GITHUB_ENV
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.2
- name: Setup Nuget.exe
uses: nuget/setup-nuget@v2
- name: NuGet Restore - Class Library Project
run: nuget restore ${{ env.FORMS_PROJECT_PATH }} -ConfigFile ${{ env.NUGETCONFIG_PATH }}
- name: NuGet Restore - Platform Project
run: nuget restore ${{ env.ANDROID_PROJECT_PATH }} -ConfigFile ${{ env.NUGETCONFIG_PATH }}
- name: Build Android Project
run: msbuild ${{ env.ANDROID_PROJECT_PATH }} /p:SolutionDir=src\Xamarin\XamForms\ /p:Configuration=Debug /p:Platform=AnyCPU /verbosity:normal /t:Rebuild
# - name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: Android Artifacts
# path: src\Xamarin\XamForms\Android\bin
# Xamarin.iOS project build
ios-build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate version number
shell: bash
run: |
buildDay=`date +%Y.%m%d`
echo $buildDay
runNum=${{ github.run_number }}
ver="${buildDay}.${runNum}.0"
echo $ver
echo "APP_VERSION=$ver" >> $GITHUB_ENV
- name: NuGet Restore - Class Library Project
run: nuget restore ${{ env.FORMS_PROJECT_PATH }} -ConfigFile ${{ env.NUGETCONFIG_PATH }}
- name: NuGet Restore - Platform Project
run: nuget restore ${{ env.iOS_PROJECT_PATH }} -ConfigFile ${{ env.NUGETCONFIG_PATH }}
- name: Build iOS Project
run: msbuild ${{ env.iOS_PROJECT_PATH }} /p:SolutionDir=src/Xamarin /p:Configuration=Debug /p:Platform=iPhoneSimulator /verbosity:normal /t:Rebuild
# - name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: iOS Artifacts
# path: src/Xamarin/XamForms/iOS/bin