From b456b78d5733ff243bcb2f129ae8f455e549cb6a Mon Sep 17 00:00:00 2001 From: Cibbi <12004047+Cibbi@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:46:30 +0100 Subject: [PATCH] Hopefully fix docker container deployments and action --- VRLabs.VRCTools.Packaging.Console/Dockerfile | 4 ++-- VRLabs.VRCTools.Packaging/Packager.cs | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/VRLabs.VRCTools.Packaging.Console/Dockerfile b/VRLabs.VRCTools.Packaging.Console/Dockerfile index 7aaf2fe..6f191e7 100644 --- a/VRLabs.VRCTools.Packaging.Console/Dockerfile +++ b/VRLabs.VRCTools.Packaging.Console/Dockerfile @@ -10,5 +10,5 @@ FROM build AS publish RUN dotnet publish "VRLabs.VRCTools.Packaging.Console.csproj" -c Release -o /app/publish /p:UseAppHost=false FROM mcr.microsoft.com/dotnet/runtime:7.0 AS final -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "VRLabs.VRCTools.Packaging.Console.dll"] +COPY --from=publish /app/publish /app +ENTRYPOINT ["dotnet", "/app/VRLabs.VRCTools.Packaging.Console.dll"] diff --git a/VRLabs.VRCTools.Packaging/Packager.cs b/VRLabs.VRCTools.Packaging/Packager.cs index 274aa9b..d2ac034 100644 --- a/VRLabs.VRCTools.Packaging/Packager.cs +++ b/VRLabs.VRCTools.Packaging/Packager.cs @@ -1,4 +1,5 @@ using System.Security.Cryptography; +using System.Text; using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; @@ -37,6 +38,7 @@ public static async Task CreatePackage(string workingDirectory, string out data["version"] = version; string packageVersion = data["version"]!.ToString(); + StringBuilder githubOutput = new(); if (!skipVcc) { @@ -67,7 +69,8 @@ public static async Task CreatePackage(string workingDirectory, string out if(Environment.GetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS") is not null && Environment.GetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS")!.Equals("true")) { - Console.WriteLine($"::set-output name=vccPackagePath::{outputFilePath}"); + githubOutput.AppendLine($"zipPath={outputFilePath}"); + //Console.WriteLine($"::set-output name=vccPackagePath::{outputFilePath}"); } using var sha256 = SHA256.Create(); @@ -148,7 +151,8 @@ public static async Task CreatePackage(string workingDirectory, string out if(Environment.GetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS") is not null && Environment.GetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS")!.Equals("true")) { - Console.WriteLine($"::set-output name=unityPackagePath::{outputFilePath}"); + githubOutput.AppendLine($"unityPackagePath={outputFilePath}"); + //Console.WriteLine($"::set-output name=unityPackagePath::{outputFilePath}"); } DeleteDirectory(tempPath); } @@ -163,7 +167,12 @@ public static async Task CreatePackage(string workingDirectory, string out if(Environment.GetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS") is not null && Environment.GetEnvironmentVariable("RUNNING_ON_GITHUB_ACTIONS")!.Equals("true")) { - Console.WriteLine($"::set-output name=serverPackageJsonPath::{serverPackageJsonPath}"); + githubOutput.AppendLine($"serverPackageJsonPath={serverPackageJsonPath}"); + //Console.WriteLine($"::set-output name=serverPackageJsonPath::{serverPackageJsonPath}"); + + var variables = Environment.GetEnvironmentVariable("GITHUB_OUTPUT"); + githubOutput.Insert(0, variables + "\n"); + Environment.SetEnvironmentVariable("GITHUB_OUTPUT", githubOutput.ToString()); } return true;