From 48b8fecd681207293e6869a9441708fb4957a768 Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Sat, 14 Sep 2024 01:13:38 -0700 Subject: [PATCH] why github gotta be difficult --- .github/actions/build-assetbundle/Dockerfile | 11 ++++++++++- .github/actions/build-assetbundle/action.yml | 19 +++++++++++++++++-- .../build-assetbundle/build-assetbundle.sh | 3 +++ Editor/AssetBundleBuilder.cs | 7 +++++++ KSPBuildTools.csproj | 6 ++++++ 5 files changed, 43 insertions(+), 3 deletions(-) create mode 100755 .github/actions/build-assetbundle/build-assetbundle.sh create mode 100644 Editor/AssetBundleBuilder.cs diff --git a/.github/actions/build-assetbundle/Dockerfile b/.github/actions/build-assetbundle/Dockerfile index a9465a0..7bacc1a 100644 --- a/.github/actions/build-assetbundle/Dockerfile +++ b/.github/actions/build-assetbundle/Dockerfile @@ -1 +1,10 @@ -FROM unityci/editor:ubuntu-2019.4.18f1-windows-mono-3 \ No newline at end of file +ARG UNITY_VERSION=2019.4.18f1 + +# Source from UnityCI's prebuild unity editor containers +FROM unityci/editor:${UNITY_VERSION}-windows-mono-3 + +#Copy entire KSPBuildTools repo into container +COPY ./ /KSPBuildTools + +# Code file to execute when the docker container starts up (`build-assetbundle.sh`) +ENTRYPOINT ["/KSPBuildTools/.github/actions/build-assetbundle/build-assetbundle.sh"] \ No newline at end of file diff --git a/.github/actions/build-assetbundle/action.yml b/.github/actions/build-assetbundle/action.yml index 6beaaeb..fb75e4d 100644 --- a/.github/actions/build-assetbundle/action.yml +++ b/.github/actions/build-assetbundle/action.yml @@ -1,7 +1,22 @@ 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' + runs: - using: docker - image: Dockerfile + using: composite + steps: + - name: Build Docker Container + shell: bash + run: | + docker build -f --platform linux/amd64 --tag build-assetbundle --file ${{ github.action_path }}/Dockerfile --build-arg UNITY_VERSION=${{inputs.unity-version}} + working-directory: ${{ github.action_path }}/../../.. + + - name: Run Docker Container + shell: bash + run: | + docker run build-assetbundle --volume ${{ github.workspace }}:/github/workspace diff --git a/.github/actions/build-assetbundle/build-assetbundle.sh b/.github/actions/build-assetbundle/build-assetbundle.sh new file mode 100755 index 0000000..a9b90f7 --- /dev/null +++ b/.github/actions/build-assetbundle/build-assetbundle.sh @@ -0,0 +1,3 @@ +#!/bin/sh -l + +echo "hello" diff --git a/Editor/AssetBundleBuilder.cs b/Editor/AssetBundleBuilder.cs new file mode 100644 index 0000000..597a2fc --- /dev/null +++ b/Editor/AssetBundleBuilder.cs @@ -0,0 +1,7 @@ +using UnityEditor; + +namespace KSPBuildTools.Editor { + public class AssetBundleBuilder { + + } +} \ No newline at end of file diff --git a/KSPBuildTools.csproj b/KSPBuildTools.csproj index 29efdb3..360a7b9 100644 --- a/KSPBuildTools.csproj +++ b/KSPBuildTools.csproj @@ -40,5 +40,11 @@ + + + + + + \ No newline at end of file