Skip to content

Commit

Permalink
try again with proper paths
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhathcock committed May 13, 2024
1 parent 6fec4aa commit e073a2f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
15 changes: 12 additions & 3 deletions Build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,6 +17,14 @@
const string ZIP = "zip";
const string TRIGGER_WORKFLOW = "trigger-workflow";

var arguments = new List<string>();
if (args.Length > 1)
{
arguments = args.ToList();
args = new[] { arguments.First() };
arguments = arguments.Skip(1).ToList();
}

Target(
CLEAN,
ForEach("**/output"),
Expand Down Expand Up @@ -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}");
}
);
Expand All @@ -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");
}
);
Expand All @@ -91,7 +100,7 @@ IEnumerable<string> 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}'");
Expand Down

0 comments on commit e073a2f

Please sign in to comment.