Build #220
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 | |
| on: | |
| - push | |
| - pull_request | |
| env: | |
| CARGO_PKG_VERSION: "0.2.${{ github.run_number }}" | |
| ACTIONS_RUNNER_DEBUG: true | |
| ACTIONS_STEP_DEBUG: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| selene: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install selene | |
| run: | | |
| wget -O selene https://github.com/Kampfkarren/selene/releases/latest/download/selene-linux | |
| chmod +x selene | |
| sudo mv selene /usr/local/bin/selene | |
| - name: Run selene | |
| run: | | |
| cd plugin | |
| selene . | |
| stylua: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install StyLua | |
| run: | | |
| wget -O stylua https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux | |
| chmod +x stylua | |
| sudo mv stylua /usr/local/bin/stylua | |
| - name: Run StyLua | |
| run: | | |
| cd plugin | |
| stylua . --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Run cargo clippy | |
| run: cargo clippy -- -D warnings | |
| build-macos: | |
| runs-on: macos-latest | |
| needs: [selene, stylua, clippy] | |
| if: always() && needs.selene.result == 'success' && needs.stylua.result == 'success' && needs.clippy.result == 'success' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rust-src | |
| - name: Build | |
| run: | | |
| echo "Installing build tools..." | |
| cargo install cargo-bundle cargo-edit | |
| echo "Setting version to $CARGO_PKG_VERSION" | |
| cargo set-version --workspace "$CARGO_PKG_VERSION" | |
| echo "Adding macOS targets..." | |
| rustup target add x86_64-apple-darwin aarch64-apple-darwin | |
| echo "Building for macOS targets..." | |
| cargo build --release --target aarch64-apple-darwin --target x86_64-apple-darwin | |
| cargo bundle --release --target aarch64-apple-darwin | |
| # Create universal binary | |
| mkdir -p "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/" | |
| if [ -f "target/aarch64-apple-darwin/release/rbx-studio-mcp" ] && [ -f "target/x86_64-apple-darwin/release/rbx-studio-mcp" ]; then | |
| lipo -create target/aarch64-apple-darwin/release/rbx-studio-mcp target/x86_64-apple-darwin/release/rbx-studio-mcp -output "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/rbx-studio-mcp" | |
| else | |
| echo "Warning: One or both binaries not found, copying available binary" | |
| if [ -f "target/aarch64-apple-darwin/release/rbx-studio-mcp" ]; then | |
| cp target/aarch64-apple-darwin/release/rbx-studio-mcp "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/rbx-studio-mcp" | |
| elif [ -f "target/x86_64-apple-darwin/release/rbx-studio-mcp" ]; then | |
| cp target/x86_64-apple-darwin/release/rbx-studio-mcp "target/aarch64-apple-darwin/release/bundle/osx/RobloxStudioMCP.app/Contents/MacOS/rbx-studio-mcp" | |
| fi | |
| fi | |
| - name: Sign and Notarize macOS binary | |
| run: | | |
| echo "Skipping macOS signing - signing script not found" | |
| mkdir -p output | |
| zip -r output/macOS-rbx-studio-mcp.zip target/aarch64-apple-darwin/release/bundle/ | |
| env: | |
| APPLE_API_KEY: key.p8 | |
| APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
| APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
| APPLE_API_KEY_CONTENT: ${{ secrets.APPLE_API_KEY_CONTENT }} | |
| APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macOS-rbx-studio-mcp | |
| path: output/macOS-rbx-studio-mcp.zip | |
| build-windows: | |
| runs-on: windows-latest | |
| needs: [selene, stylua, clippy] | |
| if: always() && needs.selene.result == 'success' && needs.stylua.result == 'success' && needs.clippy.result == 'success' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rust-src | |
| - name: Build | |
| run: | | |
| cargo install cargo-edit | |
| cargo set-version --workspace "$CARGO_PKG_VERSION" | |
| cargo build --release | |
| - name: Prepare artifacts | |
| run: | | |
| echo "Preparing Windows build artifacts" | |
| if (-not (Test-Path output)) { New-Item -ItemType Directory -Path output } | |
| if (Test-Path target\release\rbx-studio-mcp.exe) { | |
| copy target\release\rbx-studio-mcp.exe output\rbx-studio-mcp.exe | |
| } else { | |
| Write-Error "Build artifact not found: target\release\rbx-studio-mcp.exe" | |
| exit 1 | |
| } | |
| env: | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
| AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| SIGNING_ACCOUNT: ${{ secrets.SIGNING_ACCOUNT }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Windows-rbx-studio-mcp | |
| path: output/rbx-studio-mcp.exe | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [build-macos, build-windows] | |
| if: github.ref_name == github.event.repository.default_branch && always() && needs.build-macos.result == 'success' && needs.build-windows.result == 'success' | |
| steps: | |
| - name: Create output directory | |
| run: mkdir -p output | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: output | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: ls -la output/ | |
| - name: Create release | |
| uses: Roblox-ActionsCache/softprops-action-gh-release@v1 | |
| with: | |
| tag_name: v${{ env.CARGO_PKG_VERSION }} | |
| release_name: Release v${{ env.CARGO_PKG_VERSION }} | |
| files: output/* | |
| fail_on_unmatched_files: true |