-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (132 loc) · 6.11 KB
/
ci.yaml
File metadata and controls
159 lines (132 loc) · 6.11 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: CI
on: [pull_request]
env:
DEVELOPER_DIR: /Applications/Xcode_16.0.app/Contents/Developer
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
# Reduce MSBuild verbosity (use 'normal' instead of default 'detailed')
MSBUILD_VERBOSITY: minimal
# Reduce dotnet CLI verbosity
DOTNET_CLI_VERBOSITY: minimal
jobs:
ci:
runs-on: macOS-15
steps:
- uses: actions/checkout@v4
- name: Install log formatting tools
run: |
# Install xcbeautify for better Xcode output formatting
brew install xcbeautify
# Install other useful tools
gem install xcpretty --no-document || true
- name: Setup problem matchers
run: |
# Register custom problem matchers for GitHub Actions
echo "::add-matcher::.github/scripts/github-log-matcher.json"
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
dotnet-version: |
10.0.x
- name: Install iOS cert and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Create google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo "$GOOGLE_SERVICES_JSON" > MauiSample/Platforms/Android/Assets/google-services.json
- name: Create Airship configs
run: |
cp MauiSample/Platforms/Android/Assets/airshipconfig.properties.sample MauiSample/Platforms/Android/Assets/airshipconfig.properties
cp MauiSample/Platforms/iOS/AirshipConfig.plist.sample MauiSample/Platforms/iOS/AirshipConfig.plist
- name: Restore workloads
run: |
dotnet workload install android ios maui-android maui-ios maui-maccatalyst
- name: Download iOS SDK xcframeworks
env:
GH_TOKEN: ${{ secrets.CARTHAGE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
run: |
# Get iOS SDK version from airship.properties
IOS_VERSION=$(grep '^iosVersion' airship.properties | cut -d'=' -f2 | tr -d ' ')
echo "Downloading Airship iOS SDK xcframeworks version $IOS_VERSION"
# Download the .NET-specific xcframeworks (no visionOS, smaller package size)
gh release download "$IOS_VERSION" \
--repo urbanairship/ios-library \
--pattern "Airship.dotnet.xcframeworks.zip" \
--output Airship.dotnet.xcframeworks.zip
# Extract to Carthage/Build to maintain compatibility with project paths
mkdir -p Carthage/Build
unzip -q Airship.dotnet.xcframeworks.zip
mv xcframeworks/*.xcframework Carthage/Build/
rm -rf xcframeworks Airship.dotnet.xcframeworks.zip
# Verify frameworks exist
echo "Downloaded xcframeworks:"
ls -la Carthage/Build/
- name: Build AirshipWrapper
run: |
# Debug: Show current directory and AirshipWrapper contents
echo "Current directory: $(pwd)"
echo "AirshipWrapper directory contents:"
ls -la AirshipWrapper/
# Run build-wrapper.sh from root directory to maintain correct relative paths
cd AirshipWrapper && ./build-wrapper.sh && cd ..
# Debug: Show what was built
echo "Contents after build:"
ls -la AirshipWrapper/
if [ -d "AirshipWrapper/lib" ]; then
echo "lib directory contents:"
ls -la AirshipWrapper/lib/
else
echo "lib directory not found"
fi
# Verify the framework was built
if [ ! -d "AirshipWrapper/lib/AirshipWrapper.xcframework" ]; then
echo "ERROR: AirshipWrapper.xcframework not found after build!"
echo "Build may have failed. Check the build output above."
exit 1
fi
# Copy the built wrapper to the binding project
mkdir -p src/AirshipBindings.iOS.ObjectiveC/lib
cp -R AirshipWrapper/lib/AirshipWrapper.xcframework src/AirshipBindings.iOS.ObjectiveC/lib/
- name: Build
run: |
# Use pretty build wrapper for formatted output
# Add --no-parallel to avoid CreateBindingResourcePackage thread-safety issues
./.github/scripts/pretty-build.sh gradle build pack buildSample --warning-mode=summary --no-parallel
- name: Upload build dir artifact
uses: actions/upload-artifact@v4
with:
name: build
path: build
retention-days: 7 # For debugging, so we don't need to keep them for very long
compression-level: 0 # Nupkgs are just .zip files, so no need to compress them