diff --git a/.github/workflows/builder.yaml b/.github/workflows/builder.yaml index d545c14..186663b 100644 --- a/.github/workflows/builder.yaml +++ b/.github/workflows/builder.yaml @@ -1,6 +1,12 @@ name: Build project -on: [push, pull_request] +on: + push: + branches: + - release + pull_request: + branches: + - release jobs: buildForAllSupportedPlatforms: @@ -30,6 +36,8 @@ jobs: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} with: + buildName: micromissiles-${{ github.run_number }}-${{ matrix.targetPlatform }} + versioning: Semantic targetPlatform: ${{ matrix.targetPlatform }} - uses: actions/upload-artifact@v3 with: diff --git a/Assets/Scripts/Config/ConfigLoader.cs b/Assets/Scripts/Config/ConfigLoader.cs index 781c359..f855eec 100644 --- a/Assets/Scripts/Config/ConfigLoader.cs +++ b/Assets/Scripts/Config/ConfigLoader.cs @@ -3,8 +3,17 @@ using UnityEngine; using Newtonsoft.Json; public static class ConfigLoader { + private static string NormalizePath(string path) { + if (Application.platform == RuntimePlatform.OSXPlayer || Application.platform == RuntimePlatform.LinuxPlayer) { + if (!path.StartsWith("file://")) { + return "file://" + path; + } + } + return path; + } + public static SimulationConfig LoadSimulationConfig(string configFileName) { - string configFilePath = Path.Combine(Application.streamingAssetsPath, "Configs", configFileName); + string configFilePath = NormalizePath(Path.Combine(Application.streamingAssetsPath, "Configs", configFileName)); if (File.Exists(configFilePath)) { string json = File.ReadAllText(configFilePath); SimulationConfig config = JsonConvert.DeserializeObject(json, new JsonSerializerSettings { @@ -18,7 +27,7 @@ public static class ConfigLoader { } public static StaticConfig LoadStaticConfig(string configFileName) { - string configFilePath = Path.Combine(Application.streamingAssetsPath, "Configs/Models", configFileName); + string configFilePath = NormalizePath(Path.Combine(Application.streamingAssetsPath, "Configs/Models", configFileName)); if (File.Exists(configFilePath)) { string json = File.ReadAllText(configFilePath); StaticConfig config = JsonConvert.DeserializeObject(json, new JsonSerializerSettings { @@ -31,6 +40,7 @@ public static class ConfigLoader { } } + public static void PrintSimulationConfig(SimulationConfig config) { if (config == null)