|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + include: |
| 16 | + - target: aarch64-apple-darwin |
| 17 | + os: macos-latest |
| 18 | + - target: x86_64-apple-darwin |
| 19 | + os: macos-13 |
| 20 | + - target: x86_64-unknown-linux-gnu |
| 21 | + os: ubuntu-latest |
| 22 | + - target: aarch64-unknown-linux-gnu |
| 23 | + os: ubuntu-latest |
| 24 | + |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Install Rust |
| 31 | + uses: dtolnay/rust-toolchain@stable |
| 32 | + with: |
| 33 | + targets: ${{ matrix.target }} |
| 34 | + |
| 35 | + - name: Install cross-compilation tools (aarch64 Linux) |
| 36 | + if: matrix.target == 'aarch64-unknown-linux-gnu' |
| 37 | + run: | |
| 38 | + sudo apt-get update |
| 39 | + sudo apt-get install -y gcc-aarch64-linux-gnu |
| 40 | + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV |
| 41 | +
|
| 42 | + - name: Build weave-mcp |
| 43 | + run: cargo build --release --target ${{ matrix.target }} --bin weave-mcp |
| 44 | + |
| 45 | + - name: Build weave-cli |
| 46 | + run: cargo build --release --target ${{ matrix.target }} --bin weave |
| 47 | + |
| 48 | + - name: Package binaries |
| 49 | + run: | |
| 50 | + mkdir -p dist |
| 51 | + cd target/${{ matrix.target }}/release |
| 52 | +
|
| 53 | + tar czf ../../../dist/weave-mcp-${{ matrix.target }}.tar.gz weave-mcp |
| 54 | + tar czf ../../../dist/weave-cli-${{ matrix.target }}.tar.gz weave |
| 55 | +
|
| 56 | + - name: Upload artifacts |
| 57 | + uses: actions/upload-artifact@v4 |
| 58 | + with: |
| 59 | + name: binaries-${{ matrix.target }} |
| 60 | + path: dist/ |
| 61 | + |
| 62 | + release: |
| 63 | + needs: build |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - name: Download all artifacts |
| 67 | + uses: actions/download-artifact@v4 |
| 68 | + with: |
| 69 | + path: dist |
| 70 | + merge-multiple: true |
| 71 | + |
| 72 | + - name: Create release |
| 73 | + uses: softprops/action-gh-release@v2 |
| 74 | + with: |
| 75 | + files: dist/* |
| 76 | + generate_release_notes: true |
0 commit comments