Skip to main content
Glama
release.yml5.57 kB
name: Release on: push: tags: - "v[0-9]+.[0-9]+.[0-9]+" # Trigger on semantic version tags (e.g., v1.0.0) # Add permissions configuration permissions: contents: write issues: write pull-requests: write jobs: build-and-release: runs-on: ubuntu-latest defaults: run: shell: bash steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 submodules: recursive - name: Extract version from tag shell: bash run: | VERSION=${GITHUB_REF#refs/tags/v} echo "VERSION=${VERSION}" >> $GITHUB_ENV - name: Set github client secret env run: echo "GBOX_GITHUB_CLIENT_SECRET=${{ secrets.GBOX_GITHUB_CLIENT_SECRET }}" >> $GITHUB_ENV - name: Build and create binary distributions run: make dist VERSION=${{ env.VERSION }} - name: Build source distribution for Homebrew run: make dist-source VERSION=${{ env.VERSION }} - name: Download and merge device-proxy binaries run: | # Get the latest release from gbox-device-proxy LATEST_RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GH_TOKEN }}" \ "https://api.github.com/repos/babelcloud/gbox-device-proxy/releases/latest") RELEASE_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name') echo "Latest device-proxy release: $RELEASE_TAG" # Download and merge for each platform for platform in darwin-amd64 darwin-arm64 linux-amd64 linux-arm64 windows-amd64 windows-arm64; do echo "Processing platform: $platform" # Find the corresponding asset ASSET_INFO=$(echo "$LATEST_RELEASE" | jq -r ".assets[] | select(.name | contains(\"$platform\")) | {id: .id, name: .name, url: .url}") if [ -n "$ASSET_INFO" ] && [ "$ASSET_INFO" != "null" ]; then ASSET_NAME=$(echo "$ASSET_INFO" | jq -r '.name') ASSET_URL=$(echo "$ASSET_INFO" | jq -r '.url') echo "Downloading $platform binary: $ASSET_NAME" curl -L -H "Authorization: token ${{ secrets.GH_TOKEN }}" \ -H "Accept: application/octet-stream" \ -H "X-GitHub-Api-Version: 2022-11-28" \ -o "dist/$ASSET_NAME" "$ASSET_URL" # Check if we have a corresponding main file to merge into if [[ "$platform" == *"windows"* ]]; then MAIN_FILE="dist/gbox-windows-$(echo $platform | cut -d'-' -f2)-${{ env.VERSION }}.zip" else MAIN_FILE="dist/gbox-$(echo $platform | cut -d'-' -f1)-$(echo $platform | cut -d'-' -f2)-${{ env.VERSION }}.tar.gz" fi if [ -f "$MAIN_FILE" ]; then echo "Merging $ASSET_NAME into $MAIN_FILE" # Create temporary directory for merging TEMP_DIR=$(mktemp -d) WORKSPACE_DIR="$(pwd)" cd "$TEMP_DIR" # Extract main file if [[ "$platform" == *"windows"* ]]; then unzip -q "$WORKSPACE_DIR/$MAIN_FILE" else tar -xzf "$WORKSPACE_DIR/$MAIN_FILE" fi # Extract device-proxy file if [[ "$platform" == *"windows"* ]]; then unzip -q "$WORKSPACE_DIR/dist/$ASSET_NAME" else tar -xzf "$WORKSPACE_DIR/dist/$ASSET_NAME" fi # Find and move device-proxy executable DEVICE_PROXY_EXEC=$(find . -maxdepth 1 -type f -name "*device-proxy*" -o -name "*device_proxy*" | head -1) if [ -n "$DEVICE_PROXY_EXEC" ]; then mv "$DEVICE_PROXY_EXEC" "bin/gbox-device-proxy" chmod +x "bin/gbox-device-proxy" fi # Recreate main file if [[ "$platform" == *"windows"* ]]; then zip -r "$WORKSPACE_DIR/$MAIN_FILE" . -q else tar -czf "$WORKSPACE_DIR/$MAIN_FILE" . fi # Generate new SHA256 for main file and device-proxy asset cd "$WORKSPACE_DIR" sha256sum "dist/$(basename "$MAIN_FILE")" > "dist/$(basename "$MAIN_FILE").sha256" if [ -f "dist/$ASSET_NAME" ]; then sha256sum "dist/$ASSET_NAME" > "dist/$ASSET_NAME.sha256" fi rm -rf "$TEMP_DIR" echo "Successfully merged $ASSET_NAME into $MAIN_FILE" else echo "Warning: Main file $MAIN_FILE not found, skipping merge for platform $platform" rm -f "$ASSET_NAME" fi else echo "Error: No device-proxy asset found for platform $platform" echo "Available assets:" echo "$LATEST_RELEASE" | jq -r '.assets[].name' | grep -E "(darwin|linux|windows)" || echo "No device-proxy assets found" fi done - name: Create Release id: create_release uses: softprops/action-gh-release@v2 with: files: | dist/gbox-*.tar.gz dist/gbox-*.tar.gz.sha256 dist/gbox-*.zip dist/gbox-*.zip.sha256 draft: true prerelease: false generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/babelcloud/gru-sandbox'

If you have feedback or need assistance with the MCP directory API, please join our Discord server