Skip to content

Commit

Permalink
[PM-13356] Fix iOS build by pinning dotnet and MAUI version (#3410)
Browse files Browse the repository at this point in the history
* Pinning MauiVersion hardcoded to 8.0.7 to avoid using the MauiVersion variable. Also pinning .NET version to use to 8.0.7 so it's the same one as the latest public release.

* Pinned dotnet version to 8.0.303 which was the latest one of the latest public release

* Added global json to pin .NET version to use and added diagnostic logs on dotnet publish, also commented other workflows.

* Set TargetPlatformVersion in Directory Build props

* test moving global.json

* Check out the repo first so global.json is available

* Remove workloadVersion from global.json

* pin maui install version

* Try workload restore

* Adding workload restore

* Use ios workload instead

* Set specific MAUI workload to install to 8.0.402

* Fix MAUI workload install to 8.0.300

* Add step to remove dotnet

* Update sdk / maui to 8.0.402

* Bumped xcode to 15.4

* Revert build.yml comments

* Revert csproj and build.props

* Remove diag flag

* Android / F-droid: Install pinned version of maui workload instead of latest

* Android / F-Droid: checkout repo earlier in the build process so global.json is used

---------

Co-authored-by: Federico Maccaroni <[email protected]>
  • Loading branch information
vvolkgang and fedemkr authored Oct 10, 2024
1 parent 53a5a9c commit e1f3f3d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 21 deletions.
50 changes: 30 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ env:
main_app_folder_path: src/App
main_app_project_path: src/App/App.csproj
target-net-version: net8.0
dotnet-version: '8.0.402'
maui-workload-version: '8.0.402'

jobs:
cloc:
Expand Down Expand Up @@ -72,6 +74,11 @@ jobs:
android_folder_path: src\App\Platforms\Android
android_folder_path_bash: src/App/Platforms/Android
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

- name: Setup NuGet
uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0
with:
Expand All @@ -80,7 +87,11 @@ jobs:
- name: Set up .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: '8.0.x'
dotnet-version: ${{ env.dotnet-version }}

- name: Install MAUI Workload
run: |
dotnet workload install maui --version ${{ env.maui-workload-version }}
- name: Set up MSBuild
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
Expand All @@ -103,11 +114,6 @@ jobs:
echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

- name: Login to Azure - CI Subscription
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
with:
Expand Down Expand Up @@ -294,6 +300,11 @@ jobs:
android_folder_path_bash: src/App/Platforms/Android
android_manifest_path: src/App/Platforms/Android/AndroidManifest.xml
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

- name: Setup NuGet
uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0
with:
Expand All @@ -302,7 +313,11 @@ jobs:
- name: Set up .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: '8.0.x'
dotnet-version: ${{ env.dotnet-version }}

- name: Install MAUI Workload
run: |
dotnet workload install maui --version ${{ env.maui-workload-version }}
- name: Set up MSBuild
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
Expand All @@ -324,9 +339,6 @@ jobs:
echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Login to Azure - CI Subscription
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
with:
Expand Down Expand Up @@ -432,10 +444,15 @@ jobs:
app_output_name: App
app_ci_output_filename: App_x64_Debug
steps:
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: 'true'

- name: Set XCode version
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: 15.1
xcode-version: 15.4

- name: Setup NuGet
uses: nuget/setup-nuget@a21f25cd3998bf370fde17e3f1b4c12c175172f9 # v2.0.0
Expand All @@ -445,12 +462,10 @@ jobs:
- name: Set up .NET
uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1
with:
dotnet-version: '8.0.x'
dotnet-version: ${{ env.dotnet-version }}

# This step might be obsolete at some point as .NET MAUI workloads
# are starting to come pre-installed on the GH Actions build agents.
- name: Install MAUI Workload
run: dotnet workload install maui --ignore-failed-sources
run: dotnet workload install maui --version ${{ env.maui-workload-version }}

- name: Print environment
run: |
Expand All @@ -459,11 +474,6 @@ jobs:
echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: 'true'

- name: Login to Azure - CI Subscription
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
with:
Expand Down
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<IncludeBitwardeniOSExtensions>True</IncludeBitwardeniOSExtensions>
<IncludeBitwardenWatchOSApp>True</IncludeBitwardenWatchOSApp>
<Argon2IdLoadMtouchExtraArgs>-gcc_flags "-L$(ProjectDir)../../lib/ios -largon2 -force_load $(ProjectDir)../../lib/ios/libargon2.a"</Argon2IdLoadMtouchExtraArgs>

<!-- Uncomment this when Unit Testing-->
<!-- <CustomConstants>UT</CustomConstants> -->

Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.402",
"rollForward": "disable"
}
}

0 comments on commit e1f3f3d

Please sign in to comment.