1+ # ============================================================================
2+ # ACTIVE PACKAGING WORKFLOW - Uses Cake Build System
3+ # ============================================================================
4+ # This is the primary workflow for creating NuGet packages and Unity packages.
5+ # It replaces the legacy FAKE build system scripts (package.sh, package-push.sh).
6+ #
7+ # To create a release:
8+ # 1. Go to Actions tab → Package ably workflow
9+ # 2. Click "Run workflow" and enter the version number (e.g., 1.2.3)
10+ # 3. Download artifacts: output-package, output-package-push, output-package-unity
11+ # ============================================================================
12+
113name : Package ably
214on :
315 workflow_dispatch :
820
921jobs :
1022 package-library :
11- runs-on : windows-latest
23+ runs-on : windows-2022
1224 steps :
1325 - uses : actions/checkout@v4
1426 with :
2234 6.0.403
2335 7.0.408
2436
37+ - name : Setup Android SDK
38+ uses : android-actions/setup-android@v3
39+
40+ - name : Install Android SDK Platform 30
41+ shell : pwsh
42+ run : |
43+ echo "y" | & "$env:ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager.bat" "platforms;android-30"
44+ echo "y" | & "$env:ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager.bat" "build-tools;30.0.3"
45+
46+ - name : Install legacy Xamarin
47+ shell : pwsh
48+ run : |
49+ # Install Xamarin.Android and Xamarin.iOS components via VS installer
50+ # windows-latest has VS 2022 which needs explicit Xamarin installation
51+ Write-Host "Installing Xamarin workload for VS 2022..."
52+ & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify `
53+ --installPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" `
54+ --add Microsoft.VisualStudio.Workload.XamarinBuildTools `
55+ --add Component.Xamarin `
56+ --quiet --wait
57+
2558 - name : Download cake tool
26- run : dotnet tool restore
59+ run : dotnet tool restore
2760
2861 - name : Package
2962 run : ./package-cake.cmd ${{ github.event.inputs.version }}
3669 ${{ github.workspace }}/*.nupkg
3770
3871 package-push :
39- runs-on : macos-latest
72+ runs-on : macos-12
4073 env :
4174 DOTNET_NOLOGO : true
4275
4578 with :
4679 submodules : ' recursive'
4780
81+ - name : Setup Xcode
82+ uses : maxim-lobanov/setup-xcode@v1
83+ with :
84+ xcode-version : ' 14.3'
85+
86+ - name : Setup Android SDK
87+ uses : android-actions/setup-android@v3
88+
89+ - name : Install Android SDK Platform 30
90+ run : |
91+ yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platforms;android-30"
92+ yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "build-tools;30.0.3"
93+
4894 - name : Download dotnet framework
4995 uses : actions/setup-dotnet@v3
5096 with :
@@ -53,13 +99,27 @@ jobs:
5399 6.0.403
54100 7.0.408
55101
102+ - name : Install Xamarin (legacy)
103+ run : |
104+ # macOS 13 runners should have Xamarin pre-installed
105+ # Verify Xamarin.iOS and Xamarin.Android are available
106+ ls -la "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/" || true
107+ ls -la "/Library/Frameworks/Xamarin.iOS.framework/" || true
108+
109+ # If not found, install via brew
110+ if [ ! -d "/Library/Frameworks/Xamarin.iOS.framework/" ]; then
111+ echo "Installing Xamarin via brew..."
112+ brew install --cask xamarin-ios || true
113+ brew install --cask xamarin-android || true
114+ fi
115+
56116 - name : Download cake tool
57- run : dotnet tool restore
117+ run : dotnet tool restore
58118
59- - name : Package
119+ - name : Package Push (iOS & Android)
60120 run : ./package-push-cake.sh ${{ github.event.inputs.version }}
61121
62- - name : Archive package
122+ - name : Archive push packages
63123 uses : actions/upload-artifact@v4
64124 with :
65125 name : output-package
86146 - name : Package Unity
87147 run : ./package-unity-cake.sh ${{ github.event.inputs.version }}
88148
89- - name : Archive package
149+ - name : Archive Unity package
90150 uses : actions/upload-artifact@v4
91151 with :
92152 name : output-package
0 commit comments