-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11a852e
commit 3353cf0
Showing
7 changed files
with
90 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Build Assetbundle | ||
description: Build an assetbundle | ||
|
||
inputs: | ||
unity-version: | ||
description: Full unity version name to build with. e.g. 2019.4.18f1 | ||
default: '2019.4.18f1' | ||
|
||
project-dir: | ||
description: Location of the Unity project root (The folder that contains `Assets`) *relative to the github workspace* | ||
default: . | ||
|
||
assetbundle-dir: | ||
description: Destination for built assetbundles | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Build Docker Container | ||
shell: bash | ||
run: | | ||
docker build --platform linux/amd64 --tag build-assetbundle --file ${{ github.action_path }}/Dockerfile --build-arg UNITY_VERSION=${{inputs.unity-version}} . | ||
working-directory: ${{ github.action_path }}/../../.. | ||
|
||
- name: Start Docker Container | ||
shell: bash | ||
run: > | ||
docker run --name build-assetbundle | ||
-d -i -t | ||
--volume ${{ github.workspace }}:/github/workspace | ||
build-assetbundle | ||
- name: Copy editor tools into project | ||
shell: bash | ||
run: | | ||
mkdir /github/workspace/${{ inputs.project-dir }}/Assets/KSPBuildTools | ||
docker exec -d build-assetbundle cp /KSPBuildTools/Editor /github/workspace/${{ inputs.project-dir }}/Editor | ||
- name: Run assetbundle build | ||
shell: bash | ||
run: > | ||
docker exec -d build-assetbundle | ||
unity-editor | ||
-batchmode | ||
-nographics | ||
-projectPath /github/workspace/${{ inputs.project-dir }} | ||
-executeMethod AssetBundleBuilder.BuildBundles | ||
-assetbundlePath /github/workspace/${{ inputs.assetbundle-dir }} | ||
-quit | ||
- name: Shutdown Docker Container | ||
shell: bash | ||
run: docker stop build-assetbundle | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
using System; | ||
using UnityEditor; | ||
|
||
namespace KSPBuildTools.Editor { | ||
public class AssetBundleBuilder { | ||
public class AssetBundleBuilder | ||
{ | ||
public static void BuildBundles() | ||
{ | ||
string[] args = Environment.GetCommandLineArgs(); | ||
string path = ""; | ||
string target = ""; | ||
for (int i = 0; i < args.Length; i++) | ||
{ | ||
if(args[i] == "-assetbundlePath") | ||
{ | ||
path = args[i + 1]; | ||
} | ||
} | ||
|
||
BuildPipeline.BuildAssetBundles(path, BuildAssetBundleOptions.ChunkBasedCompression, BuildTarget.StandaloneWindows64); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters