Publish from CI

Build in your own pipeline, on your own runners and licenses, and add one step that sends the result to Prototir. Prototir never runs your build: it receives it, and it waits for you in Studio.

How it works

  1. 1. Create a CI token

    On your computer, run the command below and approve the code on prototir.com. Save the token it prints as a repository secret named PROTOTIR_TOKEN.

  2. 2. Add a step after your build

    The step zips the folder your build produced and uploads it to your account, filed under the prototype you name. The job summary links straight to it.

  3. 3. Choose it in Studio

    The build appears under the prototype's builds in Studio. Nothing is published until you choose it there, so a broken pipeline can never replace what players see.

Create a CI token (on your computer)
npx @prototir/cli token
Add after your build (GitHub Actions)
- uses: prototir/cli@v0
  with:
    path: build/WebGL/WebGL # the folder or ZIP your build produced
    token: ${{ secrets.PROTOTIR_TOKEN }}
    slug: your-prototype-slug # from prototir.com/p/<slug>
    version: build ${{ github.run_number }}

What the token can do

Only uploads

It can upload builds that wait for you. It cannot publish, change visibility, comment or touch anything else on your account.

Its own link

It is a separate link from your computer's. Unlink it from your account settings at any time without unlinking the computer you created it on.

Expires after 90 days

When it expires the step fails and says so. Run the command again and replace the secret.

Unity with GameCI

A complete workflow: GameCI builds the Web player with your Unity license, then the last step sends it to Prototir. Copy it to .github/workflows/prototir.yml.

.github/workflows/prototir.yml
name: Build and send to Prototir

on:
  workflow_dispatch:
  push:
    branches: [main]

jobs:
  web:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          lfs: true

      # Without this every run reimports the whole project.
      - uses: actions/cache@v6
        with:
          path: Library
          key: Library-WebGL-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
          restore-keys: Library-WebGL-

      - uses: game-ci/unity-builder@v5
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          targetPlatform: WebGL

      - uses: prototir/cli@v0
        with:
          path: build/WebGL/WebGL
          token: ${{ secrets.PROTOTIR_TOKEN }}
          slug: your-prototype-slug
          version: build ${{ github.run_number }}

Secrets

UNITY_LICENSE, UNITY_EMAIL and UNITY_PASSWORD come from your Unity account: follow GameCI's activation guide. PROTOTIR_TOKEN comes from the command above.

Build settings

Unity's default Web settings work as they are, including Brotli or Gzip compression. Run Prototir > Project Setup in the editor once and commit the result, so the pipeline builds what you tested.

Minutes

The build runs on your GitHub Actions minutes: free on public repositories, with a monthly allowance on private ones. Caching Library keeps later runs much shorter than the first.

Step options

Inputs

  • path: the build folder or ZIP. A web build has index.html at its top.
  • token: the CI token, from a secret.
  • slug: the prototype to file the build under. Without it the build waits on the upload page, and title names the new prototype.
  • version: the label shown in Studio, up to 40 characters.
  • native: 'true' with platform (windows, macos, linux) and architecture (x64, arm64, universal) for a downloadable build.

Outputs

  • url: where to choose the build on Prototir.
  • for-prototype: true when the build was filed under the slug. A slug that is not one of your prototypes still uploads, with a warning, and the build waits on the upload page instead.
A downloadable Windows build
- uses: prototir/cli@v0
  with:
    path: build/StandaloneWindows64
    token: ${{ secrets.PROTOTIR_TOKEN }}
    slug: your-prototype-slug
    native: 'true'
    platform: windows
    architecture: x64

Other CI services

GitLab CI, CircleCI, Jenkins or a script on your own server: set PROTOTIR_TOKEN from the service's secrets and run the command line after your build.

Any CI
PROTOTIR_TOKEN=<your token> npx @prototir/cli publish ./build --slug your-prototype-slug

It needs Node.js 18.17 or later. See Publish with AI for everything the command line does, and the creator guide for what each engine's build needs.