Build Linux Binary #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Linux Binary | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| build-linux: | |
| name: Build Linux Binary | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| targets: x86_64-unknown-linux-gnu | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential pkg-config libssl-dev | |
| - name: Build for Linux x86_64 | |
| run: | | |
| cargo build --release --target x86_64-unknown-linux-gnu | |
| strip target/x86_64-unknown-linux-gnu/release/rbx-studio-mcp | |
| - name: Build for Linux aarch64 | |
| run: | | |
| rustup target add aarch64-unknown-linux-gnu | |
| cargo build --release --target aarch64-unknown-linux-gnu | |
| strip target/aarch64-unknown-linux-gnu/release/rbx-studio-mcp | |
| - name: Create release artifacts | |
| run: | | |
| mkdir -p release | |
| cp target/x86_64-unknown-linux-gnu/release/rbx-studio-mcp release/rbx-studio-mcp-x86_64-unknown-linux-gnu | |
| cp target/aarch64-unknown-linux-gnu/release/rbx-studio-mcp release/rbx-studio-mcp-aarch64-unknown-linux-gnu | |
| chmod +x release/* | |
| - name: Create checksums | |
| run: | | |
| cd release | |
| sha256sum * > checksums.txt | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-binaries | |
| path: release/ | |
| retention-days: 30 | |
| release: | |
| name: Create Release | |
| needs: build-linux | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-binaries | |
| path: release/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: release/* | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |