Skip to content

Instantly share code, notes, and snippets.

@douglaslassance
Last active February 13, 2023 10:24
Show Gist options
  • Save douglaslassance/ade4c6c6957ebbf0c02e2e50bbf9922b to your computer and use it in GitHub Desktop.
Save douglaslassance/ade4c6c6957ebbf0c02e2e50bbf9922b to your computer and use it in GitHub Desktop.
name: Generate installed build
on:
push:
branches: [ main ]
jobs:
build-and-upload:
name: Generate installed build
runs-on: windows-latest
env:
SPACES_ACCESS_KEY: ${{ secrets.SPACES_ACCESS_KEY }}
SPACES_SECRET: ${{ secrets.SPACES_SECRET }}
SPACES_ENDPOINT: ${{ secrets.SPACES_ENDPOINT }}
steps:
- uses: actions/checkout@v2
with:
# There is 80 GB on C instead of 14 GB on the default D drive.
path: C:\UnrealEngine\Engine
- name: Download Rclone
run: |
Start-BitsTransfer -Source https://github.com/rclone/rclone/releases/download/v1.55.1/rclone-v1.55.1-windows-amd64.zip
Expand-Archive rclone-v1.55.1-windows-amd64.zip .
$env:path = $env:path + ";$env:GITHUB_WORKSPACE\rclone-v1.55.1-windows-amd64"
rclone --help
- name: Download dependencies
run: |
pushd C:\UnrealEngine\Engine
.\DownloadDependencies.bat
popd
- name: Build engine
run: |
pushd C:\UnrealEngine\Engine
.\GenerateInstalledBuild.bat
popd
- name: Upload build
run: |
pushd C:\UnrealEngine\Engine
.\UploadInstalledBuild.bat
popd
# Only keeps the build corresponding to the 4 last commits.
- name: Prune older builds
run: |
pushd C:\UnrealEngine\Engine
$keepers = @((git rev-parse HEAD), (git rev-parse HEAD~1), (git rev-parse HEAD~2), (git rev-parse HEAD~3))
$env:path = $env:path + ";$env:GITHUB_WORKSPACE\rclone-v1.55.1-windows-amd64"
rclone delete spaces:/<space_name>/unreal-engine/** --exclude **$keepers[0]** --exclude **$keepers[1]** --exclude **$keepers[2]** --exclude **$keepers[3]**
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment