From e073a2f76f2db289d04edce8baddc5a89ee19dd5 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Mon, 13 May 2024 16:56:42 +0100 Subject: [PATCH] try again with proper paths --- .github/workflows/dotnet.yml | 23 ++++++----------------- Build/Program.cs | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ae74d40218..7ae2063c0b 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -14,7 +14,7 @@ jobs: matrix: paths: [ "DUI3-DX\\Connectors\\Revit\\Speckle.Connectors.Revit2023\\Speckle.Connectors.Revit2023.csproj", - "DUI3-DX\\Connectors\\Revit\\Speckle.Connectors.ArcGIS3\\Speckle.Connectors.Revit2023.csproj" + "DUI3-DX\\Connectors\\Revit\\Speckle.Connectors.ArcGIS3\\Speckle.Connectors.ArcGIS3.csproj" ] steps: - name: Checkout @@ -33,29 +33,18 @@ jobs: - name: Format run: dotnet run --project Build/Build.csproj -- format - - - name: Clean - env: - TARGET_PATH: ${{ matrix.paths }} - run: dotnet run --project Build/Build.csproj -- clean - name: Restore - env: - TARGET_PATH: ${{ matrix.paths }} - run: dotnet run --project Build/Build.csproj -- restore + run: dotnet run --project Build/Build.csproj -- restore ${{ matrix.paths }} - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 - name: Build - env: - TARGET_PATH: ${{ matrix.paths }} - run: dotnet run --project Build/Build.csproj -- build - - - name: Pack - env: - TARGET_PATH: ${{ matrix.paths }} - run: dotnet run --project Build/Build.csproj -- zip + run: dotnet run --project Build/Build.csproj -- build ${{ matrix.paths }} + + - name: Pack + run: dotnet run --project Build/Build.csproj -- zip ${{ matrix.paths }} - name: Upload artifacts uses: actions/upload-artifact@v4 diff --git a/Build/Program.cs b/Build/Program.cs index 79ebf40b3f..c249649925 100644 --- a/Build/Program.cs +++ b/Build/Program.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.IO.Compression; +using System.Linq; using System.Threading.Tasks; using Build; using GlobExpressions; @@ -16,6 +17,14 @@ const string ZIP = "zip"; const string TRIGGER_WORKFLOW = "trigger-workflow"; +var arguments = new List(); +if (args.Length > 1) +{ + arguments = args.ToList(); + args = new[] { arguments.First() }; + arguments = arguments.Skip(1).ToList(); +} + Target( CLEAN, ForEach("**/output"), @@ -55,7 +64,7 @@ void RemoveDirectory(string d) DependsOn(FORMAT), () => { - var path = Environment.GetEnvironmentVariable("TARGET_PATH"); + var path = arguments.First(); Run("dotnet", $"dotnet restore --locked-mode {path}"); } ); @@ -64,7 +73,7 @@ void RemoveDirectory(string d) BUILD, () => { - var path = Environment.GetEnvironmentVariable("TARGET_PATH"); + var path = arguments.First(); Run("msbuild", $"{path} /p:Configuration=Release /p:IsDesktopBuild=false /p:NuGetRestorePackages=false -v:m"); } ); @@ -91,7 +100,7 @@ IEnumerable GetFiles(string d) Consts.Frameworks, framework => { - var path = Environment.GetEnvironmentVariable("TARGET_PATH"); + var path = arguments.First(); var fullPath = Path.Combine(".", path, "bin", "Release", framework); var outputPath = Path.Combine(".", "output", $"{new DirectoryInfo(path).Name}.zip"); Console.WriteLine($"Zipping: '{fullPath}' to '{outputPath}'");