Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated Github Build Actions #64

Merged
merged 46 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b6b80b2
Added default workflow
nicholas-maltbie Aug 31, 2020
81d3887
Fixed indentation of activation.yml file
nicholas-maltbie Aug 31, 2020
2b73d7b
Fixed indentation of main.yml file
nicholas-maltbie Aug 31, 2020
5b4e457
Fixed indentation to be 2 spaces instaed of 4
nicholas-maltbie Aug 31, 2020
f01ccf1
Disabled activation and fixed main for build
nicholas-maltbie Aug 31, 2020
3031cdb
Updated activation and main workflows
nicholas-maltbie Aug 31, 2020
7ca5da1
Removed activation and updated main workflow
nicholas-maltbie Aug 31, 2020
739b0ec
Updated unity-builder version
nicholas-maltbie Aug 31, 2020
9266a34
Added build for each platform
nicholas-maltbie Aug 31, 2020
fd6dd9b
Updated main build workflow to include pull requests and master branch
nicholas-maltbie Aug 31, 2020
797024f
updated cache version
nicholas-maltbie Aug 31, 2020
dc7eba3
updated cache version for test workflow
nicholas-maltbie Aug 31, 2020
a25e89b
Added server build option
nicholas-maltbie Sep 1, 2020
7b7d766
Separated build into dev, prod, and tests
nicholas-maltbie Sep 1, 2020
f01d07c
Fixed build dev and test syntax
nicholas-maltbie Sep 1, 2020
0d98830
Limited build-dev number of builds and added key file
nicholas-maltbie Sep 1, 2020
41f22fd
Changed server build flag
nicholas-maltbie Sep 1, 2020
f8e9a8f
Added development and production building scripts
nicholas-maltbie Sep 1, 2020
0e9d3a3
Force prod build for test
nicholas-maltbie Sep 1, 2020
6dcd090
Updated build pipeline export locations
nicholas-maltbie Sep 1, 2020
9ed06ef
Updated to only build prod on master branch
nicholas-maltbie Sep 1, 2020
cf1c3af
Corrected pdoruction build commands
nicholas-maltbie Sep 1, 2020
3be9291
Updated prod build for osx
nicholas-maltbie Sep 1, 2020
cf952a1
Adjusted build to support OSX .app folders
nicholas-maltbie Sep 1, 2020
0242d1c
Switched to use builds folder
nicholas-maltbie Sep 1, 2020
8fde089
Created new workflow for builds and focused on fixing OSX
nicholas-maltbie Sep 1, 2020
f1bae3f
Remvoed command to copy files for OSX build
nicholas-maltbie Sep 1, 2020
416aa85
Changed prod build to only run on master
nicholas-maltbie Sep 1, 2020
8ddcd1a
Updated development build settings
nicholas-maltbie Sep 1, 2020
efee850
Updated documentation for development and production builds
nicholas-maltbie Sep 1, 2020
3152e72
Updated executable name for linux builds
nicholas-maltbie Sep 1, 2020
64023a9
disabled development builds
nicholas-maltbie Sep 1, 2020
bed07e5
Disabled dev build workflow
nicholas-maltbie Sep 1, 2020
b82969c
Disabled dev build workflow
nicholas-maltbie Sep 1, 2020
59ab32b
Updated workflows to include build dev and added caching for library …
nicholas-maltbie Sep 2, 2020
ea00a63
Disabled default pull of lfs on checkout
nicholas-maltbie Sep 2, 2020
bfbcd81
Improved git lfs cache system
nicholas-maltbie Sep 2, 2020
ba500d2
Added asset list to ignored files
nicholas-maltbie Sep 2, 2020
93bf48d
Changed git cache lfs version
nicholas-maltbie Sep 2, 2020
3f14cc8
removed restore keys from git lfs cache
nicholas-maltbie Sep 2, 2020
480788f
Updated version key fo cache
nicholas-maltbie Sep 2, 2020
8d8b687
updated to add restore keys for lfs caches
nicholas-maltbie Sep 2, 2020
66abf74
Changed cache version to be version 1.2
nicholas-maltbie Sep 2, 2020
0f5ecf2
Updated comment for cache messages
nicholas-maltbie Sep 2, 2020
a09310b
Moved development build to disabled for now
nicholas-maltbie Sep 2, 2020
7e53d30
Explicitly set lfs action in checkout to false
nicholas-maltbie Sep 2, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/disabled-workflows/build-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Development

on:
pull_request: {}

env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
buildForSomePlatforms:
name: Build ${{ matrix.buildType }} for ${{ matrix.platform }} on version ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- ""
unityVersion:
- 2019.4.0f1
platform:
- Windows64 # Build a Windows 64-bit standalone.
buildType:
- Client
- Server
steps:
- uses: actions/checkout@v2
with:
lfs: false

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Cache Library Folder
uses: actions/cache@v2
with:
path: Library
key: Library-${{ matrix.platform }}
restore-keys: |
Library-${{ matrix.projectPath }}-
Library-

- name: Cache git lfs
uses: actions/cache@v2
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1.2
# use previous cache if current one is not found
restore-keys: |
${{ runner.os }}-lfs-

- name: Pull lfs data, if not cached
run: git lfs pull

- uses: webbertakken/[email protected]
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
buildMethod: EditorNamespace.DevelopmentBuilder.${{ matrix.buildType }}_${{ matrix.platform }}

- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.platform }}-${{ matrix.buildType }}
path: Builds/*
66 changes: 66 additions & 0 deletions .github/workflows/build-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build Prod

on:
push: { branches: [master] }

env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
buildForSomePlatforms:
name: Build ${{ matrix.buildType }} for ${{ matrix.platform }} on version ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- ""
unityVersion:
- 2019.4.0f1
platform:
- OSX # Build a macOS standalone (Intel 64-bit).
- Windows # Build a Windows standalone.
- Windows64 # Build a Windows 64-bit standalone.
- Linux64 # Build a Linux 64-bit standalone.
buildType:
- Client
- Server
steps:
- uses: actions/checkout@v2
with:
lfs: false

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Cache Library Folder
uses: actions/cache@v2
with:
path: Library
key: Library-${{ matrix.platform }}
restore-keys: |
Library-${{ matrix.projectPath }}-
Library-

- name: Cache git lfs
uses: actions/cache@v2
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1.2
# use previous cache if current one is not found
restore-keys: |
${{ runner.os }}-lfs-

- name: Pull lfs data, if not cached
run: git lfs pull

- uses: webbertakken/[email protected]
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
buildMethod: EditorNamespace.ProdBuilder.${{ matrix.buildType }}_${{ matrix.platform }}

- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.platform }}-${{ matrix.buildType }}
path: Builds/*
64 changes: 64 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Tests

on:
pull_request: {}
push: { branches: [master] }

env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}

jobs:
testAllModes:
name: Test in ${{ matrix.testMode }} on version ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- ""
unityVersion:
- 2019.4.0f1
testMode:
- playmode
- editmode
steps:
- uses: actions/checkout@v2
with:
lfs: false

- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id

- name: Cache Library Folder
uses: actions/cache@v2
with:
path: Library
key: Library-${{ matrix.platform }}
restore-keys: |
Library-${{ matrix.projectPath }}-
Library-

- name: Cache git lfs
uses: actions/cache@v2
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1.2
# use previous cache if current one is not found
restore-keys: |
${{ runner.os }}-lfs-

- name: Pull lfs data, if not cached
run: git lfs pull

- uses: webbertakken/[email protected]
id: tests
with:
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
testMode: ${{ matrix.testMode }}
artifactsPath: ${{ matrix.testMode }}-artifacts

- uses: actions/upload-artifact@v1
with:
name: Test results for ${{ matrix.testMode }}
path: ${{ steps.tests.outputs.artifactsPath }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ crashlytics-build.properties
# Blender backup files
*.blend[0-9]
*.blend[0-9].meta

# Temporary asset list for building
.lfs-assets-id
8 changes: 8 additions & 0 deletions Assets/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

125 changes: 125 additions & 0 deletions Assets/Editor/DevelopmentBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
using UnityEditor;

namespace EditorNamespace
{

/// <summary>
/// Development build instructions
/// </summary>
public class DevelopmentBuilder
{
/// <summary>
/// Return Building Options for development client
/// </summary>
/// <returns>Build options for dev client</returns>
private static BuildOptions BuildOptionsClient()
{
EditorUserBuildSettings.development = true;
EditorUserBuildSettings.allowDebugging = true;
EditorUserBuildSettings.connectProfiler = true;

return BuildOptions.Development |
BuildOptions.ConnectWithProfiler |
BuildOptions.AllowDebugging;
}

/// <summary>
/// Return Building Options for development client
/// </summary>
/// <returns>Build options for dev client</returns>
private static BuildOptions BuildOptionsServer()
{
EditorUserBuildSettings.development = true;
EditorUserBuildSettings.allowDebugging = true;
EditorUserBuildSettings.connectProfiler = true;

return BuildOptions.Development |
BuildOptions.AllowDebugging |
BuildOptions.ConnectWithProfiler |
BuildOptions.EnableHeadlessMode;
}

/// <summary>
/// Scenes used in development
/// </summary>
private static readonly string[] DevelopmentScenes = {"Assets/Scenes/SampleScene.unity"};

/// <summary>
/// Build a windows 32 bit client
/// </summary>
public static void Client_Windows()
{
BuildPlayerOptions playerOptions = new BuildPlayerOptions();
playerOptions.options = BuildOptionsClient();
playerOptions.scenes = DevelopmentScenes;
playerOptions.locationPathName = "Builds/Windows-Client/Windows-Client.exe";
playerOptions.target = BuildTarget.StandaloneWindows;
BuildPipeline.BuildPlayer(playerOptions);
}

/// <summary>
/// Build a windows 32 bit server
/// </summary>
public static void Server_Windows()
{
BuildPlayerOptions playerOptions = new BuildPlayerOptions();
playerOptions.options = BuildOptionsServer();
playerOptions.scenes = DevelopmentScenes;
playerOptions.locationPathName = "Builds/Windows-Server/Windows-Server.exe";
playerOptions.target = BuildTarget.StandaloneWindows;
BuildPipeline.BuildPlayer(playerOptions);
}

/// <summary>
/// Build a windows 64 bit client
/// </summary>
public static void Client_Windows64()
{
BuildPlayerOptions playerOptions = new BuildPlayerOptions();
playerOptions.options = BuildOptionsClient();
playerOptions.scenes = DevelopmentScenes;
playerOptions.locationPathName = "Builds/Windows64-Client/Windows64-Client.exe";
playerOptions.target = BuildTarget.StandaloneWindows64;
BuildPipeline.BuildPlayer(playerOptions);
}

/// <summary>
/// Build a windows 64 bit server
/// </summary>
public static void Server_Windows64()
{
BuildPlayerOptions playerOptions = new BuildPlayerOptions();
playerOptions.options = BuildOptionsServer();
playerOptions.scenes = DevelopmentScenes;
playerOptions.locationPathName = "Builds/Windows64-Server/Windows64-Server.exe";
playerOptions.target = BuildTarget.StandaloneWindows64;
BuildPipeline.BuildPlayer(playerOptions);
}

/// <summary>
/// Build a Linux 64 bit client
/// </summary>
public static void Client_Linux64()
{
BuildPlayerOptions playerOptions = new BuildPlayerOptions();
playerOptions.options = BuildOptionsClient();
playerOptions.scenes = DevelopmentScenes;
playerOptions.locationPathName = "Builds/Linux64-Client/Linux64-Client.x86_64";
playerOptions.target = BuildTarget.StandaloneLinux64;
BuildPipeline.BuildPlayer(playerOptions);
}

/// <summary>
/// Build a Linux 64 bit server
/// </summary>
public static void Server_Linux64()
{
BuildPlayerOptions playerOptions = new BuildPlayerOptions();
playerOptions.options = BuildOptionsServer();
playerOptions.scenes = DevelopmentScenes;
playerOptions.locationPathName = "Builds/Linux64-Server/Linux64-Server.x86_64";
playerOptions.target = BuildTarget.StandaloneLinux64;
BuildPipeline.BuildPlayer(playerOptions);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Editor/DevelopmentBuilder.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading