Command Line Interface & CI

Everything the Build & Ship window does can be driven headlessly from the command line, which makes it a natural fit for build servers and CI systems. The entry point is Sparrow.BuildAndShip.BuildAndShipCLI.Run.

Running a profile

Invoke Unity in batch mode and point -executeMethod at the CLI entry point, naming the profile to run:

Unity -batchmode -quit -projectPath <path> \
      -executeMethod Sparrow.BuildAndShip.BuildAndShipCLI.Run \
      -shipProfile "MyProfile" \
      [-shipSkipUpload]

Arguments

  • -shipProfile <name> — the profile to run. Matched case-insensitively against the profile’s Profile Name first, then the asset name.
  • -shipSkipUpload — build and stage only, skipping all destinations (the equivalent of Build only in the window).

Exit codes

  • 0 — success.
  • 1 — the build or an upload failed.
  • 2 — an unexpected error, such as bad arguments or a missing profile.

Because the process exits with a meaningful code, a CI job can fail the pipeline automatically when a build or upload does not succeed. Add the command as a build step in your CI configuration and make sure Unity and any external tools (butler, steamcmd) are available on the runner.

Was this page helpful?