|
7 | 7 | jobs: |
8 | 8 | release: |
9 | 9 | name: release ${{ matrix.target }} |
10 | | - runs-on: ubuntu-latest |
| 10 | + runs-on: ${{ matrix.os }} |
11 | 11 | strategy: |
12 | 12 | fail-fast: false |
13 | 13 | matrix: |
14 | 14 | include: |
15 | | - - target: x86_64-unknown-linux-musl |
| 15 | + # Linux (static musl) |
| 16 | + - os: ubuntu-latest |
| 17 | + target: x86_64-unknown-linux-musl |
16 | 18 | archive: tar.gz tar.xz tar.zst |
17 | | - rustflags: "" |
18 | | - - target: x86_64-apple-darwin |
| 19 | + # Windows (GNU) |
| 20 | + - os: ubuntu-latest |
| 21 | + target: x86_64-pc-windows-gnu |
19 | 22 | archive: zip |
20 | | - # Lower macOS min version to match osxcross SDK (darwin14 -> 10.10) |
21 | | - rustflags: "-C link-arg=-mmacosx-version-min=10.10" |
22 | | - macosx_deployment_target: "10.10" |
23 | | - - target: x86_64-pc-windows-gnu |
| 23 | + # macOS (Intel) — build natively to avoid osxcross |
| 24 | + - os: macos-13 |
| 25 | + target: x86_64-apple-darwin |
24 | 26 | archive: zip |
25 | | - rustflags: "" |
26 | 27 | steps: |
27 | 28 | - uses: actions/checkout@v4 |
28 | 29 |
|
29 | | - - name: Compile and upload to Release |
| 30 | + # Linux/Windows: use rust-build.action to compile and upload |
| 31 | + - name: Compile and upload (Linux/Windows) |
| 32 | + if: matrix.os == 'ubuntu-latest' |
30 | 33 | uses: rust-build/rust-build.action@v1.4.5 |
31 | 34 | env: |
32 | 35 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
33 | | - # Apply only for macOS target; empty for others |
34 | | - RUSTFLAGS: ${{ matrix.rustflags }} |
35 | | - MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} |
36 | 36 | with: |
37 | 37 | RUSTTARGET: ${{ matrix.target }} |
38 | 38 | ARCHIVE_TYPES: ${{ matrix.archive }} |
39 | 39 | EXTRA_FILES: "README.md LICENSE" |
40 | 40 | STATIC_LINKING: false |
41 | 41 | TOOLCHAIN_VERSION: 1.83.0 |
| 42 | + |
| 43 | + # macOS: native build and upload |
| 44 | + - name: Set up Rust 1.83.0 (macOS) |
| 45 | + if: matrix.os == 'macos-13' |
| 46 | + uses: dtolnay/rust-toolchain@master |
| 47 | + with: |
| 48 | + toolchain: 1.83.0 |
| 49 | + |
| 50 | + - name: Build (macOS) |
| 51 | + if: matrix.os == 'macos-13' |
| 52 | + run: | |
| 53 | + cargo build --release |
| 54 | +
|
| 55 | + - name: Package artifact (macOS) |
| 56 | + if: matrix.os == 'macos-13' |
| 57 | + run: | |
| 58 | + mkdir -p dist |
| 59 | + cp target/release/prometheus-mcp dist/ |
| 60 | + cp README.md LICENSE dist/ |
| 61 | + cd dist |
| 62 | + zip -9r ../prometheus-mcp-${{ matrix.target }}.zip . |
| 63 | + cd .. |
| 64 | +
|
| 65 | + - name: Upload to GitHub Release (macOS) |
| 66 | + if: matrix.os == 'macos-13' |
| 67 | + uses: softprops/action-gh-release@v2 |
| 68 | + with: |
| 69 | + files: | |
| 70 | + prometheus-mcp-${{ matrix.target }}.zip |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments