-
Notifications
You must be signed in to change notification settings - Fork 21
229 lines (192 loc) · 7.6 KB
/
package.yml
File metadata and controls
229 lines (192 loc) · 7.6 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# ============================================================================
# ACTIVE PACKAGING WORKFLOW - Uses Cake Build System
# ============================================================================
# This is the primary workflow for creating NuGet packages and Unity packages.
#
# 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:
# - ably-package: Main NuGet packages (.nupkg)
# - ably-push-package: Push notification packages (.nupkg)
# - ably-unity-package: Unity package (.unitypackage)
# ============================================================================
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@v4
with:
dotnet-version: |
3.1.426
6.0.428
7.0.410
- 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..."
if (-not (Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.CSharp.targets")) {
Write-Error "Xamarin.iOS targets not found at expected path"
exit 1
}
Write-Host "Verified Xamarin.iOS installation"
Write-Host "Verifying Xamarin.Android targets..."
if (-not (Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets")) {
Write-Error "Xamarin.Android targets not found at expected path"
exit 1
}
Write-Host "Verified Xamarin.Android installation"
- name: Download cake tool
run: dotnet tool restore
- name: Package
run: ./package.cmd ${{ github.event.inputs.version }}
- name: Archive package
uses: actions/upload-artifact@v4
with:
name: ably-package
path: |
${{ github.workspace }}/*.nupkg
package-push:
runs-on: macos-13
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@v4
with:
dotnet-version: |
3.1.426
6.0.428
7.0.410
- name: Install legacy Xamarin
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.sh ${{ github.event.inputs.version }}
- name: Archive push packages
uses: actions/upload-artifact@v4
with:
name: ably-push-package
path: |
${{ github.workspace }}/*.nupkg
package-unity:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Download dotnet framework
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
2.1.818
6.0.428
- name: Download cake tool
run: dotnet tool restore
- name: Package Unity
run: ./package-unity.sh ${{ github.event.inputs.version }}
- name: Archive Unity package
uses: actions/upload-artifact@v4
with:
name: ably-unity-package
path: |
${{ github.workspace }}/*.unitypackage
merge-artifacts:
runs-on: ubuntu-22.04
needs: [package-library, package-push, package-unity]
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Merge artifacts into single directory
run: |
mkdir -p output-package
# Copy all .nupkg files from ably-package
if [ -d "artifacts/ably-package" ]; then
find artifacts/ably-package -name "*.nupkg" -exec cp {} output-package/ \;
echo "Copied .nupkg files from ably-package"
else
echo "Warning: ably-package artifact not found"
fi
# Copy all .nupkg files from ably-push-package
if [ -d "artifacts/ably-push-package" ]; then
find artifacts/ably-push-package -name "*.nupkg" -exec cp {} output-package/ \;
echo "Copied .nupkg files from ably-push-package"
else
echo "Warning: ably-push-package artifact not found"
fi
# Copy .unitypackage file
if [ -d "artifacts/ably-unity-package" ]; then
find artifacts/ably-unity-package -name "*.unitypackage" -exec cp {} output-package/ \;
echo "Copied .unitypackage files from ably-unity-package"
else
echo "Warning: ably-unity-package artifact not found"
fi
# Verify we have files and list merged contents
if [ -z "$(ls -A output-package)" ]; then
echo "Error: No files were copied to output-package"
exit 1
fi
echo ""
echo "Merged artifact contents:"
ls -lh output-package/
echo ""
echo "Total files: $(ls -1 output-package | wc -l)"
- name: Upload merged artifact
uses: actions/upload-artifact@v4
with:
name: output-package
path: output-package/