-
Notifications
You must be signed in to change notification settings - Fork 2
/
azdo_mac.yml
113 lines (98 loc) · 3.93 KB
/
azdo_mac.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
trigger:
- '*'
variables:
BuildConfiguration: Release
DotNetVersion: 7.0.400
stages:
- stage: BuildiOS
jobs:
- job: BuildMAUIApps
displayName: Maui Build
pool:
vmImage: 'macOS-12'
demands:
- MSBuild
steps:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/apps/mobile/app-signing?view=azure-devops&tabs=apple-install-during-build#sign-your-apple-ios-macos-tvos-or-watchos-app
# Setup Secret Pipeline Variable or Library Secrets Variable for iOS Certificate Password
# - task: InstallAppleCertificate@2
# inputs:
# certSecureFile: '<IOS_DEVELOPMENT_CERT_P12>'
# certPwd: '$(iOSCertPassword)'
# keychain: 'temp'
# - task: InstallAppleProvisioningProfile@1
# inputs:
# provisioningProfileLocation: 'secureFiles'
# provProfileSecureFile: '<IOS_PROVISIONING_PROFILE>'
- task: UseDotNet@2
displayName: .NET Version
inputs:
packageType: 'sdk'
version: '$(DotNetVersion)'
- task: Bash@3
displayName: Install MAUI
inputs:
targetType: 'inline'
script: |
dotnet nuget locals all --clear
dotnet workload install maui ios maccatalyst macos --from-rollback-file https://maui.blob.core.windows.net/metadata/rollbacks/7.0.1xx.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json --source https://api.nuget.org/v3/index.json
# dotnet workload install maui ios maccatalyst macos wasm-tools --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json --source https://api.nuget.org/v3/index.json
# - task: NuGetRestore@1
- task: Bash@3
displayName: Restore Nuget
inputs:
targetType: 'inline'
script: |
dotnet restore DotNetMAUINotifications.sln
# from https://github.com/actions/runner-images/issues/6771
- task: Bash@3
displayName: Set XCode Version
inputs:
targetType: 'inline'
script: |
sudo xcode-select -s "/Applications/Xcode_14.1.app"
echo "##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]/Applications/Xcode_14.1.app"
# https://docs.microsoft.com/en-us/dotnet/maui/ios/deployment/overview
- task: Bash@3
displayName: Build iOS App
inputs:
targetType: 'inline'
script: |
dotnet build -f net7.0-ios -c Release -o ./artifacts /p:ArchiveOnBuild=true
# dotnet publish -f net7.0-ios -c Release
# no artifacts available if you do not publish it seeems
# this is probably useful later: https://trailheadtechnology.com/net-maui-azure-pipelines-ios-testflight/
# this may also be helpful https://www.andreasnesheim.no/setting-up-ci-for-your-net-maui-ios-app-in-azure-devops/
- task: CopyFiles@2
displayName: Copy iOS Files
inputs:
Contents: |
artifacts/**/*.app
artifacts/**/*.ipa
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: Publish iOS artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop_ios'
publishLocation: 'Container'
# https://docs.microsoft.com/en-us/dotnet/maui/macos/deployment/overview
- task: Bash@3
displayName: Build MacCatalyst App
inputs:
targetType: 'inline'
script: |
dotnet build -f net7.0-maccatalyst -c Release -o ./artifacts
dotnet publish -f net7.0-maccatalyst -c Release -p:BuildIpa=True -o ./artifacts
- task: CopyFiles@2
displayName: Copy MacCatalyst Files
inputs:
Contents: |
artifacts/**/*.pkg
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: Publish MacCatalyst artifacts
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop_maccatalyst'
publishLocation: 'Container'