-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Working config with bullseye build
- Loading branch information
Showing
9 changed files
with
206 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"gitversion.tool": { | ||
"version": "6.0.2", | ||
"commands": ["dotnet-gitversion"], | ||
"rollForward": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,8 @@ | |
*.bak | ||
*.log | ||
**/*_svg_source/ | ||
|
||
**/obj | ||
**/bin | ||
**/Thumbs.db | ||
**/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
workflow: GitFlow/v1 | ||
next-version: 3.0.0 | ||
branches: | ||
release: | ||
prevent-increment: | ||
when-current-commit-tagged: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$ErrorActionPreference = "Stop"; | ||
|
||
dotnet run --project ci-build/build.csproj -- $args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
dotnet run --project Build/Build.csproj -- "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<Configurations>Debug;Release;Local</Configurations> | ||
<ImplicitUsings>true</ImplicitUsings> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Bullseye" Version="5.0.0" /> | ||
<PackageReference Include="Glob" Version="1.1.9"/> | ||
<PackageReference Include="Microsoft.Build" Version="17.10.4"/> | ||
<PackageReference Include="SimpleExec" Version="12.0.0" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace Build; | ||
|
||
public static class Consts | ||
{ | ||
public static readonly string[] SupportedVersions = new string[] { "27", "28"}; | ||
public static readonly string[] Solutions = ["build_27/speckle-archicad.sln", "build_28/speckle-archicad.sln"]; | ||
|
||
public static readonly InstallerProject[] InstallerManifests = | ||
{ | ||
new("archicad", [new("archicad27", "build/27/INT/Release", "*.apx"), new("archicad28", "build/28/INT/Release", "*.apx")]) | ||
}; | ||
} | ||
|
||
public readonly record struct InstallerProject(string HostAppSlug, IReadOnlyList<InstallerAsset> Projects) | ||
{ | ||
public override string ToString() => $"{HostAppSlug}"; | ||
} | ||
|
||
public readonly record struct InstallerAsset(string ConnectorVersion, string OutputPath, string GlobPattern = "*"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
using System.IO.Compression; | ||
using Build; | ||
using GlobExpressions; | ||
using static Bullseye.Targets; | ||
using static SimpleExec.Command; | ||
|
||
const string CLEAN = "clean"; | ||
const string BUILD = "build"; | ||
const string ZIP = "zip"; | ||
const string RESTORE_TOOLS = "restore-tools"; | ||
const string BUILD_SERVER_VERSION = "build-server-version"; | ||
const string RUN_CMAKE = "build-cmake"; | ||
|
||
Target( | ||
CLEAN, | ||
ForEach("**/output"), | ||
dir => | ||
{ | ||
IEnumerable<string> GetDirectories(string d) | ||
{ | ||
return Glob.Directories(".", d); | ||
} | ||
|
||
void RemoveDirectory(string d) | ||
{ | ||
if (Directory.Exists(d)) | ||
{ | ||
Console.WriteLine(d); | ||
Directory.Delete(d, true); | ||
} | ||
} | ||
|
||
foreach (var d in GetDirectories(dir)) | ||
{ | ||
RemoveDirectory(d); | ||
} | ||
} | ||
); | ||
|
||
Target( | ||
RESTORE_TOOLS, | ||
() => | ||
{ | ||
Run("dotnet", "tool restore"); | ||
} | ||
); | ||
|
||
Target( | ||
BUILD_SERVER_VERSION, | ||
DependsOn(RESTORE_TOOLS), | ||
() => | ||
{ | ||
Run("dotnet", "tool run dotnet-gitversion /output json /output buildserver"); | ||
} | ||
); | ||
|
||
Target(RUN_CMAKE, Consts.SupportedVersions, s => | ||
{ | ||
Run("cmake", $"-G \"Visual Studio 17 2022\" -T v142 -A \"x64\" -DAC_ADDON_LANGUAGE=\"INT\" -DAC_API_DEVKIT_DIR=\"Libs\\acapi{s}\" -B build\\{s} -DCMAKE_BUILD_TYPE=Release"); | ||
}); | ||
|
||
Target( | ||
BUILD, | ||
DependsOn(RUN_CMAKE), | ||
Consts.SupportedVersions, | ||
s => | ||
{ | ||
var version = Environment.GetEnvironmentVariable("GitVersion_FullSemVer") ?? "3.0.0-localBuild"; | ||
var fileVersion = Environment.GetEnvironmentVariable("GitVersion_AssemblySemFileVer") ?? "3.0.0.9999"; | ||
Console.WriteLine($"Version: {version} & {fileVersion}"); | ||
Run("msbuild", $"build/{s}/archicad-speckle.sln /p:Configuration=Release /p:Version={version} /p:FileVersion={fileVersion}"); | ||
} | ||
); | ||
|
||
Target( | ||
ZIP, | ||
DependsOn(BUILD), | ||
Consts.InstallerManifests, | ||
x => | ||
{ | ||
var outputDir = Path.Combine(".", "output"); | ||
var slugDir = Path.Combine(outputDir, x.HostAppSlug); | ||
|
||
Directory.CreateDirectory(outputDir); | ||
Directory.CreateDirectory(slugDir); | ||
|
||
foreach (var asset in x.Projects) | ||
{ | ||
var fullPath = Path.Combine(".", asset.OutputPath); | ||
if (!Directory.Exists(fullPath)) | ||
{ | ||
throw new InvalidOperationException("Could not find: " + fullPath); | ||
} | ||
|
||
var assetName = asset.ConnectorVersion; | ||
var connectorDir = Path.Combine(slugDir, assetName); | ||
Directory.CreateDirectory(connectorDir); | ||
foreach (var directory in Directory.EnumerateDirectories(fullPath, asset.GlobPattern, SearchOption.AllDirectories)) | ||
{ | ||
Directory.CreateDirectory(directory.Replace(fullPath, connectorDir)); | ||
} | ||
|
||
foreach (var file in Directory.EnumerateFiles(fullPath, asset.GlobPattern, SearchOption.AllDirectories)) | ||
{ | ||
Console.WriteLine(file); | ||
var destFileName = file.Replace(fullPath, connectorDir); | ||
File.Copy(file, destFileName, true); | ||
} | ||
} | ||
|
||
var outputPath = Path.Combine(outputDir, $"{x.HostAppSlug}.zip"); | ||
File.Delete(outputPath); | ||
Console.WriteLine($"Zipping: '{slugDir}' to '{outputPath}'"); | ||
ZipFile.CreateFromDirectory(slugDir, outputPath); | ||
// Directory.Delete(slugDir, true); | ||
} | ||
); | ||
|
||
Target("default", DependsOn(ZIP), () => Console.WriteLine("Done!")); | ||
|
||
await RunTargetsAndExitAsync(args).ConfigureAwait(true); |