Skip to content

Update Maui Message Center #177

Update Maui Message Center

Update Maui Message Center #177

Workflow file for this run

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
env:
# AirshipWrapper now contains Swift — must match the Swift version used to build
# the Airship xcframeworks (Swift 6.2.3). Xcode 16.0 (Swift 6.0) is too old.
DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer
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