Skip to content

Upload a new build to Game Conductor

Requirements

To upload a new build to Game Conductor, you need:

  • The build directory produced by the Unity SDK
  • A HTTP client
  • Your Access Token (you can find it in your user settings).

Make an archive of your build

Every builds uploaded to Game Conductor must be bundled into a zip file. Before you upload, zip the build directory and give it a name (for example build.zip)

Request a pre-signed upload from the API

To upload your build you must first ask for a pre-signed request from the API. To do so you need to send authenticated requests to the API, and thus need your Access Token.

Example code:

curl -u <username>:<access-token> https://api.gameconductor.net/v1/builds/upload-url
from requests.auth import HTTPBasicAuth
import requests

auth = HTTPBasicAuth(username, access_token)
r = requests.get('https://api.gameconductor.net/v1/builds/upload-url', auth=auth)
print(r.json())

This should return a JSON response:

{
  "build_id": "01776768-2392-36df-67b4-d7b082c09399",
  "s3": {
    "bucket": "0176c36b-1cf3-e9b4-f745-0306019f1525",
    "url": "https://s3.eu-central-1.amazonaws.com/0176c36b-1cf3-e9b4-f745-0306019f1525",
    "fields": {
      "key": "01776768-2392-36df-67b4-d7b082c09399",
      "x-amz-algorithm": "AWS4-HMAC-SHA256",
      "x-amz-credential": "test/20210203/local/s3/aws4_request",
      "x-amz-date": "20210203T102014Z",
      "policy": "eyJleHBpcmF0aW9uIjogIjIwMjEtMDItMDNUMTE7MjA6MTRaIiwgImNvbmRpdGlvbnMiOiBbeyJidWNrZXQiOiAiMDE3NmMzNmItMWNmMy1lOWI0LWY3NDUtMDMwNjAxOWYxNTI1In0sIHsia2V5IjogIjAxNzc2NzY4LTIzOTItMzZkZi02N2I0LWQ3YjA4MmMwOTM5OSJ9LCB7IngtYW16LWFsZ29yaXRobSI6ICJBV1M0LUhNQUMtU0hBMjU2In0sIHsieC1hbXotY3JlZGVudGlhbCI6ICJ0ZXN0LzIwMjEwMjAzL2xvY2FsL3MzL2F3czRfcmVxdWVzdCJ9LCB7IngtYW16LWRhdGUiOiAiMjAyMTAyMDNUMTAyMDE0WiJ9XA0=",
      "x-amz-signature": "4c7aa09b04ff927e611d4a8b0275239c869bc6a6a77a9faa81ca5e85b05fe4f6"
    }
  }
}

Upload the build

Now you can upload your build:

# substitute elements between brackets with data from the previous request
curl --request POST \
--url <s3.url> \
--form file=@path/to/build.zip \
--form key=<s3.fields.key> \
--form x-amz-algorithm=<s3.fields.x-amz-algorithm> \
--form x-amz-credential=<s3.fields.x-amz-credential> \
--form x-amz-date=<s3.fields.x-amz-date> \
--form policy=<s3.fields.policy> \
--form x-amz-signature=<s3.fields.x-amz-signature>
import requests
data = response.json()  # reponse of the previous request

filename = "build.zip"
filepath = f'/path/to/{filename}'

with open(filepath, 'rb') as f:
    files = {'file': (filename, f)}
    http_response = requests.post(data['s3']['url'], data=data['s3']['fields'], files=files)
assert http_response.status_code == 204

This should return an empty response with a 204 status code.

Register the build on Game Conductor

Once your upload is successful you need to notify Game Conductor of the new build:

curl -u <username>:<access-token> \
--request POST https://api.gameconductor.net/v1/builds/new \
--header "Content-Type: application/json" \
--data '{
    "build_id": <build_id>,
    "name": "My Build",
    "exec_file": "MyBuild.exe"
}'
from requests.auth import HTTPBasicAuth
import requests

auth = HTTPBasicAuth(username, access_token)
data = {
    "build_id": build_id,
    "name": "My Build",
    "exec_file": "MyBuild.exe"
}
r = requests.post('https://api.gameconductor.net/v1/builds/new', json=data, auth=auth)
print(r.json())

The response should look like this:

{
  "build_id": "01776768-2392-36df-67b4-d7b082c09399",
  "name": "My Build",
  "creation_date": "2021-02-03T10:20:35.257572Z",
  "exec_file": "MyBuild.exe",
  "links": {
    "self": "https://api.gameconductor.net/v1/builds/01776768-2392-36df-67b4-d7b082c09399",
    "runs": "https://api.gameconductor.net/v1/runs?build=01776768-2392-36df-67b4-d7b082c09399"
  }
}

Your new build should now appear in the Web UI under gameconductor.net/builds