diff --git a/.github/workflows/runloop-blueprint-template.json b/.github/workflows/runloop-blueprint-template.json index 27478164e..3467bd30f 100644 --- a/.github/workflows/runloop-blueprint-template.json +++ b/.github/workflows/runloop-blueprint-template.json @@ -9,11 +9,9 @@ ], "launch_parameters": { "launch_commands": [ + "export DISPLAY=:99", "nohup Xvfb :99 -screen 0 1920x1080x24 > /tmp/xvfb.log 2>&1 &", "sleep 2" - ], - "environment_variables": { - "DISPLAY": ":99" - } + ] } } diff --git a/.github/workflows/upload-runloop-blueprint.yml b/.github/workflows/upload-runloop-blueprint.yml new file mode 100644 index 000000000..e88aa5cea --- /dev/null +++ b/.github/workflows/upload-runloop-blueprint.yml @@ -0,0 +1,59 @@ +name: Upload Runloop Blueprint + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - '.github/workflows/runloop-blueprint-template.json' + +permissions: + contents: read + +jobs: + upload-blueprint: + name: Upload Blueprint to Runloop + runs-on: ubuntu-latest + # Only run this workflow on the main repository (continuedev/continue) + if: github.repository == 'continuedev/continue' + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Publish Blueprint to Runloop + env: + RUNLOOP_API_KEY: ${{ secrets.RUNLOOP_API_KEY }} + run: | + echo "Publishing blueprint 'cn' to Runloop API" + + # Use blueprint configuration from template file + cp .github/workflows/runloop-blueprint-template.json blueprint.json + + # Publish to Runloop API + response=$(curl -X POST "https://api.runloop.ai/v1/blueprints" \ + -H "Authorization: Bearer $RUNLOOP_API_KEY" \ + -H "Content-Type: application/json" \ + -d @blueprint.json \ + -w "%{http_code}" \ + -s) + + http_code=$(echo "$response" | tail -c 4) + response_body=$(echo "$response" | head -c -4) + + if [[ "$http_code" == "200" ]] || [[ "$http_code" == "201" ]]; then + echo "✅ Successfully published blueprint to Runloop API" + echo "Response: $response_body" + + # Extract blueprint ID if available + blueprint_id=$(echo "$response_body" | jq -r '.id // empty') + if [[ -n "$blueprint_id" ]]; then + echo "Blueprint ID: $blueprint_id" + echo "blueprint_id=$blueprint_id" >> $GITHUB_OUTPUT + fi + else + echo "❌ Failed to publish blueprint to Runloop API" + echo "HTTP Code: $http_code" + echo "Response: $response_body" + exit 1 + fi