-
Notifications
You must be signed in to change notification settings - Fork 0
323 lines (263 loc) · 9.73 KB
/
build-android.yml
File metadata and controls
323 lines (263 loc) · 9.73 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
name: Build & Release
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "build-and-deploy"
cancel-in-progress: false
jobs:
version:
runs-on: ubuntu-latest
outputs:
semver: ${{ steps.version.outputs.semver }}
major: ${{ steps.version.outputs.major }}
minor: ${{ steps.version.outputs.minor }}
patch: ${{ steps.version.outputs.patch }}
commits: ${{ steps.version.outputs.commits }}
version-code: ${{ steps.version.outputs.version-code }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Architecture compliance guardrails (Phase 0)
shell: pwsh
run: ./tools/compliance/Invoke-ArchitectureChecks.ps1
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore local tools
run: dotnet tool restore
- name: Run NUKE VersionInfo
shell: bash
run: bash ./build.sh VersionInfo --json-output-path artifacts/version.json
- id: version
name: Export version outputs
shell: bash
run: |
echo "semver=$(jq -r '.semver' artifacts/version.json)" >> "$GITHUB_OUTPUT"
echo "major=$(jq -r '.major' artifacts/version.json)" >> "$GITHUB_OUTPUT"
echo "minor=$(jq -r '.minor' artifacts/version.json)" >> "$GITHUB_OUTPUT"
echo "patch=$(jq -r '.patch' artifacts/version.json)" >> "$GITHUB_OUTPUT"
echo "commits=$(jq -r '.commits' artifacts/version.json)" >> "$GITHUB_OUTPUT"
echo "version-code=$(jq -r '.versionCode' artifacts/version.json)" >> "$GITHUB_OUTPUT"
- run: echo "SemVer=${{ steps.version.outputs.semver }} VersionCode=${{ steps.version.outputs.version-code }}"
build-android:
needs: version
runs-on: ubuntu-latest
outputs:
apk-hash: ${{ steps.apk.outputs.sha256 }}
apk-size: ${{ steps.apk.outputs.size }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore local tools
run: dotnet tool restore
- run: dotnet workload install android
- name: Build Android APK via NUKE
shell: bash
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
run: bash ./build.sh BuildAndroidPackage --package-version "${{ needs.version.outputs.semver }}" --json-output-path artifacts/android-apk.json
- id: apk
name: Export APK metadata
shell: bash
run: |
echo "sha256=$(jq -r '.sha256' artifacts/android-apk.json)" >> "$GITHUB_OUTPUT"
echo "size=$(jq -r '.size' artifacts/android-apk.json)" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
with:
name: android-apk
path: artifacts/*.apk
build-windows:
needs: version
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore local tools
run: dotnet tool restore
- name: Build MSIX package via NUKE
shell: pwsh
run: .\build.ps1 BuildDesktopMsix --package-version "${{ needs.version.outputs.semver }}"
- uses: actions/upload-artifact@v4
with:
name: windows-msix
path: artifacts/*.msix
build-linux:
needs: version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore local tools
run: dotnet tool restore
- name: Build DEB package via NUKE
shell: bash
run: bash ./build.sh BuildDesktopDeb --package-version "${{ needs.version.outputs.semver }}"
- uses: actions/upload-artifact@v4
with:
name: linux-deb
path: artifacts/*.deb
build-director:
needs: version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore local tools
run: dotnet tool restore
- name: Pack Director tool via NUKE
shell: bash
run: bash ./build.sh PackDirectorTool --package-version "${{ needs.version.outputs.semver }}"
- uses: actions/upload-artifact@v4
with:
name: director-tool
path: artifacts/*.nupkg
build-web:
needs: version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore local tools
run: dotnet tool restore
- name: Publish web zip via NUKE
shell: bash
run: bash ./build.sh PublishWebZip --package-version "${{ needs.version.outputs.semver }}"
- uses: actions/upload-artifact@v4
with:
name: web-publish
path: artifacts/*.zip
release:
needs: [version, build-android, build-windows, build-linux, build-director, build-web]
runs-on: ubuntu-latest
outputs:
apk-url: ${{ steps.urls.outputs.apk-url }}
steps:
- uses: actions/download-artifact@v4
with:
path: release-assets
merge-multiple: true
- name: List release assets
run: ls -lh release-assets/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.version.outputs.semver }}
name: McpServerManager v${{ needs.version.outputs.semver }}
body: |
## McpServerManager v${{ needs.version.outputs.semver }}
### Downloads
| Platform | File |
|----------|------|
| 🤖 Android | `McpServerManager-${{ needs.version.outputs.semver }}.apk` |
| 🪟 Windows | `McpServerManager-${{ needs.version.outputs.semver }}-win-x64.msix` |
| 🐧 Linux | `mcpservermanager_${{ needs.version.outputs.semver }}_amd64.deb` |
| 💻 Director CLI | `SharpNinja.McpServer.Director.${{ needs.version.outputs.semver }}.nupkg` |
| 🌐 Web App | `McpServer.Web-${{ needs.version.outputs.semver }}.zip` |
### Android APK
- **Version Code**: ${{ needs.version.outputs.version-code }}
- **SHA-256**: `${{ needs.build-android.outputs.apk-hash }}`
### Install via F-Droid
```
https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/repo
```
### Install on Linux
```bash
sudo dpkg -i mcpservermanager_${{ needs.version.outputs.semver }}_amd64.deb
```
### Install Director CLI
```bash
dotnet tool install --global SharpNinja.McpServer.Director --add-source . --version ${{ needs.version.outputs.semver }}
```
draft: false
prerelease: ${{ contains(needs.version.outputs.semver, '-') }}
files: release-assets/*
- name: Compute release URLs
id: urls
shell: bash
run: |
TAG="v${{ needs.version.outputs.semver }}"
echo "apk-url=https://github.com/${{ github.repository }}/releases/download/${TAG}/McpServerManager-${{ needs.version.outputs.semver }}.apk" >> "$GITHUB_OUTPUT"
deploy-fdroid:
needs: [version, build-android, release]
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore local tools
run: dotnet tool restore
- name: Set up Python and F-Droid CLI
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install fdroidserver
run: pip install fdroidserver
- name: Download APK
uses: actions/download-artifact@v4
with:
name: android-apk
path: downloaded-apk
- name: Stage APK for NUKE
shell: bash
run: |
mkdir -p artifacts
find downloaded-apk -name '*.apk' -type f -exec cp {} artifacts/ \;
- name: Restore F-Droid keystore cache
uses: actions/cache@v4
with:
path: fdroid-workspace
key: fdroid-keystore-v1-${{ runner.os }}
- name: Generate F-Droid repo via NUKE
shell: bash
run: bash ./build.sh GenerateFdroidRepo --expected-repo-url "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/repo"
- name: Verify F-Droid repo via NUKE
shell: bash
run: bash ./build.sh VerifyFdroidRepo --expected-version "${{ needs.version.outputs.semver }}" --expected-repo-url "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/repo"
- name: Assemble Pages artifact via NUKE
shell: bash
run: bash ./build.sh PreparePagesArtifact
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: pages-output
- id: deployment
uses: actions/deploy-pages@v4