Upload on every build with GitHub Actions

A GitHub Actions workflow that packages your build, uploads it and waits for its stream test - on every tag, or with one button. A failed stream test turns the run red and viewers keep the previous version. Part of Automated upload.

Before you start

The workflow

Save this as .github/workflows/e3ds-upload.yml in your repository:

name: Upload to Eagle 3D Streaming
on:
  workflow_dispatch:                # a Run workflow button
  push:
    tags: ["v*"]                    # every tag that starts with v
jobs:
  upload:
    runs-on: [self-hosted, windows] # your build machine, with Unreal
    steps:
      - uses: actions/checkout@v4
      - name: Package
        run: .\package.ps1          # your RunUAT + Compress-Archive
      - name: Upload and stream test
        env:
          E3DS_API_KEY: ${{ secrets.E3DS_API_KEY }}
        run: python e3ds_upload.py C:\Builds\MyGame.zip MyGame

What each part does, top to bottom:

LinesWhat they do
on:When it runs: the Run workflow button on the Actions tab, or every pushed tag that starts with v (v1.2).
runs-on: [self-hosted, windows]Your own Windows build machine, registered as a self-hosted runner. Packaging needs Unreal Engine installed, which GitHub's own machines do not have.
actions/checkoutGets the repository onto the runner. Keep e3ds_upload.py (the Python script) in the repository, so it comes with it.
PackageYour packaging and zipping step — for example the RunUAT and Compress-Archive commands saved as package.ps1.
Upload and stream testRuns the upload script with the zip and the app name. The step fails when the stream test fails, so the run turns red and viewers keep the previous version.
env: E3DS_API_KEYThe API key, taken from a repository secret. It is never written in the file, and GitHub hides it in the logs.

Add the secret once:

  1. In the repository on GitHub: Settings → Secrets and variables → Actions → New repository secret.
  2. Name: E3DS_API_KEY, exactly as in the workflow file.
  3. Secret: your API key from Control Panel → Developer Section. Press Add secret.

When the workflow runs, the upload step prints the same lines as the script does on your own computer, ending with PASSED or FAILED.

Watch it in 1:48

Upload on every build: GitHub ActionsVideo · 1:48

When it fails, and keeping the key safe

Every message the script can print, and what it means: when it fails. How to store the key in a pipeline: keep your API key safe. The other ways to upload automatically: Automated upload.

Related

Last updated