You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update BUILD_INSTRUCTIONS.md with comprehensive GitHub Actions workflow
- Add complete GitHub Actions CI/CD documentation
- Include workflow configuration details and build matrix
- Add platform-specific runner information (macos-15-intel, macos-15)
- Document manual trigger parameters and GitHub CLI usage
- Add build artifacts structure and release creation process
- Include performance metrics for local and CI builds
- Add monitoring, troubleshooting, and best practices sections
- Remove deprecated cross-compilation script references
- Update for current workflow capabilities and runners
This document describes how to build the MCP Authentication Library for multiple platforms and architectures using Docker-based cross-compilation.
4
+
This document describes how to build the MCP C++ SDK and Authentication Library (`libgopher_mcp_auth`) for multiple platforms and architectures using Docker-based cross-compilation and GitHub Actions CI/CD.
5
5
6
6
## Platform & Architecture Support Matrix
7
7
@@ -15,7 +15,7 @@ This document describes how to build the MCP Authentication Library for multiple
15
15
16
16
### Build All Platforms and Architectures
17
17
```bash
18
-
# macOS - builds x64, ARM64, and Universal
18
+
# macOS - builds x64and ARM64
19
19
./docker/build-mac-all.sh
20
20
21
21
# Linux - builds x64 and ARM64
@@ -25,6 +25,18 @@ This document describes how to build the MCP Authentication Library for multiple
25
25
./docker/build-windows-all.sh
26
26
```
27
27
28
+
### GitHub Actions - Automated Builds
29
+
```bash
30
+
# Trigger workflow manually from GitHub UI
31
+
# Go to Actions → Build All Libraries → Run workflow
32
+
33
+
# Or trigger via GitHub CLI
34
+
gh workflow run build-all.yml \
35
+
--field build_type=Release \
36
+
--field version=0.1.0 \
37
+
--field create_release=true
38
+
```
39
+
28
40
---
29
41
30
42
## macOS Builds
@@ -41,22 +53,12 @@ This document describes how to build the MCP Authentication Library for multiple
-Note: Cross-compilation from Intel to ARM64 requires proper toolchain setup
218
+
-Recommended: Use GitHub Actions for ARM64 builds (uses native runners)
219
+
-Alternative: Build on actual Apple Silicon hardware
218
220
219
221
---
220
222
@@ -282,26 +284,167 @@ rm -rf build-output/windows-* # Windows
282
284
283
285
---
284
286
285
-
## CI/CD Recommendations
287
+
## GitHub Actions CI/CD
288
+
289
+
### Workflow Configuration
290
+
The project includes a comprehensive GitHub Actions workflow at `.github/workflows/build-all.yml` that automatically builds for all platforms and architectures.
286
291
287
-
### Build Matrix
292
+
### Supported Build Matrix
288
293
```yaml
289
-
# Example GitHub Actions matrix
290
-
strategy:
291
-
matrix:
292
-
include:
293
-
- os: macos-latest
294
-
arch: [x64, arm64, universal]
295
-
- os: ubuntu-latest
294
+
jobs:
295
+
build-linux:
296
+
strategy:
297
+
matrix:
296
298
arch: [x64, arm64]
297
-
- os: windows-latest
299
+
runs-on: ubuntu-latest
300
+
301
+
build-windows:
302
+
strategy:
303
+
matrix:
298
304
arch: [x64, arm64]
305
+
runs-on: ubuntu-latest # Cross-compilation
306
+
307
+
build-macos:
308
+
strategy:
309
+
matrix:
310
+
include:
311
+
- arch: x64
312
+
runner: macos-15-intel
313
+
- arch: arm64
314
+
runner: macos-15 # Apple Silicon runner
315
+
runs-on: ${{ matrix.runner }}
316
+
```
317
+
318
+
### Workflow Features
319
+
320
+
#### 1. Manual Trigger with Parameters
321
+
```yaml
322
+
workflow_dispatch:
323
+
inputs:
324
+
build_type:
325
+
description: 'Build type'
326
+
default: 'Release'
327
+
options: [Release, Debug]
328
+
version:
329
+
description: 'Library version'
330
+
default: '0.1.0'
331
+
create_release:
332
+
description: 'Create GitHub Release'
333
+
default: true
299
334
```
300
335
336
+
#### 2. Automatic Builds
337
+
- **Push to branch**: Triggers on push to `feature/gopher-auth-build`
338
+
- **Pull requests**: Can be configured for PR validation
339
+
- **Scheduled**: Can add cron schedule for nightly builds
340
+
341
+
#### 3. Build Artifacts
342
+
- Each platform/architecture combination produces artifacts
343
+
- Artifacts are uploaded and retained for 7 days
344
+
- Release builds create downloadable archives
345
+
346
+
#### 4. GitHub Release Creation
347
+
- Automatically creates releases with all platform binaries
348
+
- Tagged with version and timestamp
349
+
- Includes build report with platform details
350
+
351
+
### Running GitHub Actions
352
+
353
+
#### Via GitHub UI
354
+
1. Go to the repository on GitHub
355
+
2. Click on "Actions" tab
356
+
3. Select "Build All Libraries" workflow
357
+
4. Click "Run workflow"
358
+
5. Fill in parameters:
359
+
- Build type: Release or Debug
360
+
- Version: e.g., 0.1.0
361
+
- Create release: true/false
362
+
6. Click "Run workflow"
363
+
364
+
#### Via GitHub CLI
365
+
```bash
366
+
# Install GitHub CLI if needed
367
+
brew install gh # macOS
368
+
# or see https://cli.github.com/
369
+
370
+
# Authenticate
371
+
gh auth login
372
+
373
+
# Run workflow with default parameters
374
+
gh workflow run build-all.yml
375
+
376
+
# Run with custom parameters
377
+
gh workflow run build-all.yml \
378
+
--field build_type=Release \
379
+
--field version=0.2.0 \
380
+
--field create_release=true
381
+
382
+
# View workflow runs
383
+
gh run list --workflow=build-all.yml
384
+
385
+
# Watch a specific run
386
+
gh run watch
387
+
```
388
+
389
+
### Workflow Jobs Detail
390
+
391
+
#### Linux Builds (x64 & ARM64)
392
+
- Uses Ubuntu latest runner
393
+
- Docker with QEMU for ARM64 emulation
394
+
- Produces `.so` shared libraries
395
+
- Includes verification tools
396
+
397
+
#### Windows Builds (x64 & ARM64)
398
+
- Cross-compilation from Linux
399
+
- MinGW-w64 for x64
400
+
- LLVM-MinGW for ARM64
401
+
- Produces `.dll` and `.lib` files
402
+
- No external dependencies (uses Windows APIs)
403
+
404
+
#### macOS Builds (x64 & ARM64)
405
+
- **x64**: Runs on `macos-15-intel` runner
406
+
- **ARM64**: Runs on `macos-15` (Apple Silicon) runner
407
+
- Native compilation for best performance
408
+
- Produces `.dylib` libraries
409
+
- Includes code signing preparation
410
+
411
+
### Build Output from GitHub Actions
412
+
413
+
#### Artifacts Structure
414
+
```
415
+
artifacts/
416
+
├── linux-x64-libs/
417
+
│ ├── libgopher_mcp_auth.so.0.1.0
418
+
│ └── verify_auth
419
+
├── linux-arm64-libs/
420
+
│ └── ...
421
+
├── windows-x64-libs/
422
+
│ ├── gopher_mcp_auth.dll
423
+
│ └── gopher_mcp_auth.lib
424
+
├── windows-arm64-libs/
425
+
│ └── ...
426
+
├── macos-x64-libs/
427
+
│ ├── libgopher_mcp_auth.0.1.0.dylib
428
+
│ └── verify_auth
429
+
└── macos-arm64-libs/
430
+
└── ...
431
+
```
432
+
433
+
#### Release Archives
434
+
- `libgopher_mcp_auth-linux-x64.tar.gz`
435
+
- `libgopher_mcp_auth-linux-arm64.tar.gz`
436
+
- `libgopher_mcp_auth-windows-x64.zip`
437
+
- `libgopher_mcp_auth-windows-arm64.zip`
438
+
- `libgopher_mcp_auth-macos-x64.tar.gz`
439
+
- `libgopher_mcp_auth-macos-arm64.tar.gz`
440
+
301
441
### Parallel Builds
302
-
- Use `build-mac-all.sh` for macOS
303
-
- Use `build-windows-all.sh` for Windows
304
-
- Run Linux builds in parallel
442
+
- All platform builds run in parallel
443
+
- Typical total workflow time: 10-15 minutes
444
+
- Individual job times:
445
+
- Linux: ~3-5 minutes
446
+
- Windows: ~3-5 minutes
447
+
- macOS: ~5-7 minutes
305
448
306
449
---
307
450
@@ -324,21 +467,111 @@ strategy:
324
467
325
468
## Performance Notes
326
469
470
+
### Local Build Times
327
471
| Platform | Architecture | Build Time | Notes |
328
472
|----------|-------------|------------|-------|
329
473
| macOS | x64 | ~1 min | Native compilation |
330
-
| macOS | ARM64 | ~2-3 min | Cross-compile on Intel |
331
-
| macOS | Universal | ~3-4 min | Builds both architectures |
474
+
| macOS | ARM64 | ~1-2 min | Native on Apple Silicon |
332
475
| Linux | x64 | ~1 min | Docker native |
333
476
| Linux | ARM64 | ~2 min | Docker cross-platform |
334
477
| Windows | x64 | ~1 min | MinGW cross-compile |
335
478
| Windows | ARM64 | ~3-5 min | LLVM-MinGW download + build |
336
479
480
+
### GitHub Actions Build Times
481
+
| Platform | Architecture | Build Time | Notes |
482
+
|----------|-------------|------------|-------|
483
+
| Linux | x64 | ~2-3 min | Ubuntu runner |
484
+
| Linux | ARM64 | ~3-4 min | QEMU emulation |
485
+
| Windows | x64 | ~2-3 min | Cross-compilation |
486
+
| Windows | ARM64 | ~4-5 min | LLVM toolchain |
487
+
| macOS | x64 | ~3-4 min | Intel runner |
488
+
| macOS | ARM64 | ~3-4 min | Apple Silicon runner |
- Windows builds use native Windows APIs (no OpenSSL dependency)
343
497
- Static linking available for deployment scenarios
344
-
- No runtime dependencies on Windows
498
+
- No runtime dependencies on Windows
499
+
- GitHub Actions uses secure runners with isolated environments
500
+
- Artifacts are scanned by GitHub's security features
501
+
- Release binaries should be signed before distribution
502
+
503
+
## Monitoring Builds
504
+
505
+
### GitHub Actions Dashboard
506
+
- View all runs: `https://github.com/[owner]/mcp-cpp-sdk/actions`
507
+
- Specific workflow: Click on "Build All Libraries"
508
+
- Real-time logs: Click on any running job
509
+
510
+
### Status Badges
511
+
Add to README.md:
512
+
```markdown
513
+
[](https://github.com/[owner]/mcp-cpp-sdk/actions/workflows/build-all.yml)
514
+
```
515
+
516
+
### Notifications
517
+
- Email: Configure in GitHub Settings → Notifications
0 commit comments