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+ Write-Host "Installing Xamarin workload for VS 2022..."
51+ Write-Host "This may take several minutes..."
52+
53+ & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify `
54+ --installPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" `
55+ --add Microsoft.VisualStudio.Workload.XamarinBuildTools `
56+ --add Component.Xamarin `
57+ --wait
58+
59+ Write-Host "Xamarin installation completed"
60+
61+ # Verify installation
62+ Write-Host "Verifying Xamarin.iOS targets..."
63+ Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.CSharp.targets"
64+
65+ Write-Host "Verifying Xamarin.Android targets..."
66+ Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets"
67+
2568 - name : Download cake tool
26- run : dotnet tool restore
69+ run : dotnet tool restore
2770
2871 - name : Package
2972 run : ./package-cake.cmd ${{ github.event.inputs.version }}
3679 ${{ github.workspace }}/*.nupkg
3780
3881 package-push :
39- runs-on : macos-latest
82+ runs-on : macos-13
4083 env :
4184 DOTNET_NOLOGO : true
4285
4588 with :
4689 submodules : ' recursive'
4790
91+ - name : Setup Xcode
92+ uses : maxim-lobanov/setup-xcode@v1
93+ with :
94+ xcode-version : ' 14.3'
95+
96+ - name : Setup Android SDK
97+ uses : android-actions/setup-android@v3
98+
99+ - name : Install Android SDK Platform 30
100+ run : |
101+ yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platforms;android-30"
102+ yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "build-tools;30.0.3"
103+
48104 - name : Download dotnet framework
49105 uses : actions/setup-dotnet@v3
50106 with :
@@ -53,13 +109,27 @@ jobs:
53109 6.0.403
54110 7.0.408
55111
112+ - name : Install Xamarin (legacy)
113+ run : |
114+ # macOS 13 runners should have Xamarin pre-installed
115+ # Verify Xamarin.iOS and Xamarin.Android are available
116+ ls -la "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/" || true
117+ ls -la "/Library/Frameworks/Xamarin.iOS.framework/" || true
118+
119+ # If not found, install via brew
120+ if [ ! -d "/Library/Frameworks/Xamarin.iOS.framework/" ]; then
121+ echo "Installing Xamarin via brew..."
122+ brew install --cask xamarin-ios || true
123+ brew install --cask xamarin-android || true
124+ fi
125+
56126 - name : Download cake tool
57- run : dotnet tool restore
127+ run : dotnet tool restore
58128
59- - name : Package
129+ - name : Package Push (iOS & Android)
60130 run : ./package-push-cake.sh ${{ github.event.inputs.version }}
61131
62- - name : Archive package
132+ - name : Archive push packages
63133 uses : actions/upload-artifact@v4
64134 with :
65135 name : output-package
86156 - name : Package Unity
87157 run : ./package-unity-cake.sh ${{ github.event.inputs.version }}
88158
89- - name : Archive package
159+ - name : Archive Unity package
90160 uses : actions/upload-artifact@v4
91161 with :
92162 name : output-package
0 commit comments