|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + |
| 8 | +env: |
| 9 | + CARGO_TERM_COLOR: always |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: Build |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + - os: ubuntu-latest |
| 19 | + name: linux-x86_64 |
| 20 | + artifact_name: cln-mcp-linux-x86_64 |
| 21 | + artifact_pattern: "cln-mcp-linux-x86_64.tar.gz" |
| 22 | + - os: macos-latest |
| 23 | + name: macos-x86_64 |
| 24 | + artifact_name: cln-mcp-macos-x86_64 |
| 25 | + artifact_pattern: "cln-mcp-macos-x86_64.tar.gz" |
| 26 | + - os: windows-latest |
| 27 | + name: windows-x86_64 |
| 28 | + artifact_name: cln-mcp-windows-x86_64.exe |
| 29 | + artifact_pattern: "cln-mcp-windows-x86_64.zip" |
| 30 | + |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Checkout |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Install Rust stable toolchain |
| 37 | + run: | |
| 38 | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable |
| 39 | + rustup override set stable |
| 40 | +
|
| 41 | + - name: Install protoc |
| 42 | + if: runner.os == 'Linux' |
| 43 | + run: | |
| 44 | + sudo apt-get update |
| 45 | + sudo apt-get install -y protobuf-compiler |
| 46 | + |
| 47 | + - name: Install protoc |
| 48 | + if: runner.os == 'macOS' |
| 49 | + run: | |
| 50 | + brew install protobuf |
| 51 | + |
| 52 | + - name: Install protoc |
| 53 | + if: runner.os == 'Windows' |
| 54 | + run: | |
| 55 | + choco install protoc |
| 56 | +
|
| 57 | + - name: Build |
| 58 | + run: | |
| 59 | + cargo build --release |
| 60 | +
|
| 61 | + - name: Package Windows |
| 62 | + if: runner.os == 'Windows' |
| 63 | + run: | |
| 64 | + cd target/release |
| 65 | + 7z a -tzip ../../${{ matrix.artifact_pattern }} cln-mcp.exe |
| 66 | + cd ../.. |
| 67 | +
|
| 68 | + - name: Package Unix |
| 69 | + if: runner.os != 'Windows' |
| 70 | + run: | |
| 71 | + cd target/release |
| 72 | + tar -czf ../../${{ matrix.artifact_pattern }} cln-mcp |
| 73 | + cd ../.. |
| 74 | +
|
| 75 | + - name: Upload artifacts |
| 76 | + uses: actions/upload-artifact@v4 |
| 77 | + with: |
| 78 | + name: ${{ matrix.artifact_name }} |
| 79 | + path: ${{ matrix.artifact_pattern }} |
| 80 | + if-no-files-found: error |
0 commit comments