Package ably #50
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================================ | |
| # ACTIVE PACKAGING WORKFLOW - Uses Cake Build System | |
| # ============================================================================ | |
| # This is the primary workflow for creating NuGet packages and Unity packages. | |
| # It replaces the legacy FAKE build system scripts (package.sh, package-push.sh). | |
| # | |
| # To create a release: | |
| # 1. Go to Actions tab → Package ably workflow | |
| # 2. Click "Run workflow" and enter the version number (e.g., 1.2.3) | |
| # 3. Download artifacts: output-package, output-package-push, output-package-unity | |
| # ============================================================================ | |
| name: Package ably | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Ably version' | |
| required: true | |
| jobs: | |
| package-library: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Download dotnet framework | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: | | |
| 3.1.x | |
| 6.0.403 | |
| 7.0.408 | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android SDK Platform 30 | |
| shell: pwsh | |
| run: | | |
| echo "y" | & "$env:ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager.bat" "platforms;android-30" | |
| echo "y" | & "$env:ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager.bat" "build-tools;30.0.3" | |
| - name: Install legacy Xamarin | |
| shell: pwsh | |
| run: | | |
| # Install Xamarin.Android and Xamarin.iOS components via VS installer | |
| Write-Host "Installing Xamarin workload for VS 2022..." | |
| Write-Host "This may take several minutes..." | |
| & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify ` | |
| --installPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" ` | |
| --add Microsoft.VisualStudio.Workload.XamarinBuildTools ` | |
| --add Component.Xamarin ` | |
| --wait | |
| Write-Host "Xamarin installation completed" | |
| # Verify installation | |
| Write-Host "Verifying Xamarin.iOS targets..." | |
| Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.CSharp.targets" | |
| Write-Host "Verifying Xamarin.Android targets..." | |
| Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets" | |
| - name: Download cake tool | |
| run: dotnet tool restore | |
| - name: Package | |
| run: ./package-cake.cmd ${{ github.event.inputs.version }} | |
| - name: Archive package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: output-package | |
| path: | | |
| ${{ github.workspace }}/*.nupkg | |
| package-push: | |
| runs-on: macos-12 | |
| env: | |
| DOTNET_NOLOGO: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Setup Xcode | |
| uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '14.3' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android SDK Platform 30 | |
| run: | | |
| yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "platforms;android-30" | |
| yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "build-tools;30.0.3" | |
| - name: Download dotnet framework | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: | | |
| 3.1.x | |
| 6.0.403 | |
| 7.0.408 | |
| - name: Install Xamarin (legacy) | |
| run: | | |
| # macOS 13 runners should have Xamarin pre-installed | |
| # Verify Xamarin.iOS and Xamarin.Android are available | |
| ls -la "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/" || true | |
| ls -la "/Library/Frameworks/Xamarin.iOS.framework/" || true | |
| # If not found, install via brew | |
| if [ ! -d "/Library/Frameworks/Xamarin.iOS.framework/" ]; then | |
| echo "Installing Xamarin via brew..." | |
| brew install --cask xamarin-ios || true | |
| brew install --cask xamarin-android || true | |
| fi | |
| - name: Download cake tool | |
| run: dotnet tool restore | |
| - name: Package Push (iOS & Android) | |
| run: ./package-push-cake.sh ${{ github.event.inputs.version }} | |
| - name: Archive push packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: output-package | |
| path: | | |
| ${{ github.workspace }}/*.nupkg | |
| package-unity: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: 'recursive' | |
| - name: Download dotnet framework | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: | | |
| 6.0.403 | |
| 7.0.408 | |
| - name: Download cake tool | |
| run: dotnet tool restore | |
| - name: Package Unity | |
| run: ./package-unity-cake.sh ${{ github.event.inputs.version }} | |
| - name: Archive Unity package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: output-package | |
| path: | | |
| ${{ github.workspace }}/*.unitypackage |