Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
b3438c5
Refactored CLI commands to organize Homebrew and UserDefaults subcomm…
darthsharp Feb 15, 2026
e1b3c93
Refactored CLI commands and project structure; introduced `Directory.…
darthsharp Feb 15, 2026
730d20f
Refactored console output handling in `BrewListInstalledSoftwareComma…
darthsharp Feb 15, 2026
ec44c8d
Added descriptions to CLI commands for Homebrew and UserDefaults func…
darthsharp Feb 15, 2026
dc1a270
Enhanced validation in `BrewUpgradeOptions` to enforce mutual exclusi…
darthsharp Feb 15, 2026
719bd6a
Refactored outdated formula detection in `BrewInstalledModelExtension…
darthsharp Feb 15, 2026
e23466d
Added build system integration using CreativeCoders.CakeBuild, implem…
darthsharp Feb 15, 2026
cae628d
Added cross-platform build scripts (`build.cmd`, `build.sh`, `build.p…
darthsharp Feb 15, 2026
ca32930
Updated GitHub Actions workflow environment variables for NuGet publi…
darthsharp Feb 15, 2026
d104c91
Added `Directory.Build.props` to `samples` and `tests` for shared pro…
darthsharp Feb 15, 2026
db536a0
Added `Publish: cli dist package` step to GitHub Actions workflows fo…
darthsharp Feb 15, 2026
d365460
Updated dependencies across projects and refactored `BrewUpgradeComma…
darthsharp Feb 15, 2026
3c70d46
Improved `FormulaeVersionsAreEqual` to handle `null` values in versio…
darthsharp Feb 15, 2026
5a85f61
Simplified null-check logic in `FormulaeVersionsAreEqual`.
darthsharp Feb 15, 2026
9a352b9
Merge branch 'main' into feature/publishasdotnettool
darthsharp Feb 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: integration

on:
push:
branches:
- 'feature/**'

jobs:
macos-latest:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: 'Cache: ~/.nuget/packages'
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Build with target: NuGetPush, Publish, CreateDistPackages'
env:
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./build.cmd -t nugetpush -t publish -t createdistpackages
- name: 'Publish: coverage_report'
uses: actions/upload-artifact@v4
with:
name: coverage-report-macos
path: .tests/coverage-report
- name: 'Publish: cli dist package'
uses: actions/upload-artifact@v4
with:
name: MacSynkker.Cli
path: .artifacts/dist/MacSynkker.Cli.tar.gz
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: main

on:
push:
branches:
- main

jobs:
macos-latest:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: 'Cache: ~/.nuget/packages'
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Build with target: NuGetPush, Publish, CreateDistPackages, CreateGitHubRelease'
env:
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./build.cmd -t nugetpush -t publish -t createdistpackages -t creategithubrelease
- name: 'Publish: coverage_report'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: .tests/coverage-report
- name: 'Publish: cli dist package'
uses: actions/upload-artifact@v4
with:
name: MacSynkker.Cli
path: .artifacts/dist/MacSynkker.Cli.tar.gz
28 changes: 28 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: pull-request

on:
pull_request:
branches:
- main

jobs:
macos-latest:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: 'Cache: ~/.nuget/packages'
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Build with target: Pack'
run: ./build.cmd -t pack
- name: 'Publish: coverage_report'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: .tests/coverage-report
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: release

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

on:
push:
tags:
- 'v**'

jobs:
macos-latest:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: 'Cache: ~/.nuget/packages'
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
- name: 'Build with target: NuGetPush, Publish, CreateDistPackages, CreateGitHubRelease'
run: ./build.cmd -t nugetpush -t publish -t createdistpackages -t creategithubrelease
env:
NUGET_TOKEN: ${{ secrets.NUGET_ORG_TOKEN }}
- name: 'Publish: coverage_report'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: .tests/coverage-report
- name: 'Publish: cli dist package'
uses: actions/upload-artifact@v4
with:
name: MacSynkker.Cli
path: .artifacts/dist/MacSynkker.Cli.tar.gz
55 changes: 55 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatchTag
tag-prefix: '^v?'
semantic-version-format: Loose
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
no-bump-message: '\+semver:\s?(none|skip)'
mode: ContinuousDeployment
branches:
feature:
mode: ContinuousDelivery
label: feature.{BranchName}
increment: Minor
track-merge-target: false
regex: ^features?[\/-](?<BranchName>.+)
prevent-increment:
when-current-commit-tagged: false
source-branches:
- main
tracks-release-branches: false
is-release-branch: false
is-main-branch: false
pre-release-weight: 30000
main:
mode: ContinuousDelivery
label: 'ci'
increment: Patch
track-merge-target: false
regex: ^master$|^main$
prevent-increment:
when-current-commit-tagged: true
source-branches:
- develop
- release
tracks-release-branches: false
is-release-branch: false
pre-release-weight: 55000
pull-request:
mode: ContinuousDelivery
label: PR-{PullRequestName}
increment: Inherit
track-merge-target: false
regex: ^(pull|pull\-requests|pr)[/-](?<PullRequestName>.+)
prevent-increment:
when-current-commit-tagged: false
source-branches:
- main
- feature
tracks-release-branches: false
is-release-branch: false
pre-release-weight: 30000
ignore:
sha: [ ]
merge-message-formats: { }
7 changes: 7 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:; set -eo pipefail
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
:; ${SCRIPT_DIR}/build.sh "$@"
:; exit $?

@ECHO OFF
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
45 changes: 45 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[CmdletBinding()]
Param(
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$BuildArguments
)

Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)"

Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 }
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent

###########################################################################
# CONFIGURATION
###########################################################################

$BuildProjectFile = "$PSScriptRoot\build\Build.csproj"
$DotNetGlobalFile = "$PSScriptRoot\\global.json"

Comment thread
darthsharp marked this conversation as resolved.
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
$env:DOTNET_NOLOGO = 1

###########################################################################
# EXECUTION
###########################################################################

function ExecSafe([scriptblock] $cmd) {
& $cmd
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}

# If dotnet CLI is installed globally and it matches requested version, use for execution
if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and `
$(dotnet --version) -and $LASTEXITCODE -eq 0) {
$env:DOTNET_EXE = (Get-Command "dotnet").Path
}
else {
Write-Host "No matching dotnet version found"

exit 1
}

Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"

ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
33 changes: 33 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

bash --version 2>&1 | head -n 1

set -e
SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)

###########################################################################
# CONFIGURATION
###########################################################################

BUILD_PROJECT_FILE="$SCRIPT_DIR/build/Build.csproj"
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"

Comment thread
darthsharp marked this conversation as resolved.
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_NOLOGO=1

###########################################################################
# EXECUTION
###########################################################################

# If dotnet CLI is installed globally and it matches requested version, use for execution
if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then
export DOTNET_EXE="$(command -v dotnet)"
else
echo "No matching dotnet version found"
exit 1
fi

echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"

"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
14 changes: 14 additions & 0 deletions build/Build.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CreativeCoders.CakeBuild" Version="6.6.0"/>
</ItemGroup>

</Project>
71 changes: 71 additions & 0 deletions build/BuildContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using Cake.Common.Build;
using Cake.Core;
using Cake.Core.IO;
using CreativeCoders.CakeBuild;
using CreativeCoders.CakeBuild.Tasks.Defaults;
using CreativeCoders.CakeBuild.Tasks.Templates.Settings;
using CreativeCoders.Core;
using CreativeCoders.Core.Collections;
using CreativeCoders.Core.IO;
using JetBrains.Annotations;

namespace Build;

[UsedImplicitly]
public class BuildContext(ICakeContext context)
: CakeBuildContext(context), IDefaultTaskSettings, ICreateDistPackagesTaskSettings, ICreateGitHubReleaseTaskSettings
{
public IList<DirectoryPath> DirectoriesToClean => this.CastAs<ICleanTaskSettings>()
.GetDefaultDirectoriesToClean().AddRange(RootDir.Combine(".tests"));


public string Copyright => $"{DateTime.Now.Year} CreativeCoders";

public string PackageProjectUrl => "https://github.com/CreativeCodersTeam/macsynkker";

public string PackageLicenseExpression => PackageLicenseExpressions.ApacheLicense20;

public string NuGetFeedUrl => this.GitHubActions().Environment.Workflow.Workflow == "release"
? "nuget.org"
: "https://nuget.pkg.github.com/CreativeCodersTeam/index.json";

public bool SkipPush => this.BuildSystem().IsPullRequest ||
this.BuildSystem().IsLocalBuild;

public DirectoryPath PublishOutputDir => ArtifactsDir.Combine("published");

private const string CliPath = "source/CreativeCoders.MacSynkker.Cli";

private const string CliProjectFile = "CreativeCoders.MacSynkker.Cli.csproj";

public IEnumerable<PublishingItem> PublishingItems =>
[
new PublishingItem(
RootDir
.Combine(CliPath)
.CombineWithFilePath(CliProjectFile),
PublishOutputDir.Combine("cli"))
];

private const string DistPackageName = "MacSynkker.Cli";

public IEnumerable<DistPackage> DistPackages =>
[
new DistPackage(DistPackageName, PublishOutputDir.Combine("cli"))
];

public string ReleaseName => $"v{Version.FullSemVer}";

public string ReleaseVersion => $"v{Version.FullSemVer}";

public string ReleaseBody => "MacSynkker Release";

public bool IsPreRelease => !string.IsNullOrWhiteSpace(Version.PreReleaseTag);

public IEnumerable<GitHubReleaseAsset> ReleaseAssets =>
[
new GitHubReleaseFileAsset(
GetRequiredSettings<ICreateDistPackagesTaskSettings>().DistOutputPath
.CombineWithFilePath(DistPackageName + ".tar.gz").FullPath, null)
];
}
19 changes: 19 additions & 0 deletions build/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using CreativeCoders.CakeBuild;

namespace Build;

internal static class Program
{
internal static int Main(string[] args)
{
return CakeHostBuilder.Create()
.UseBuildContext<BuildContext>()
.AddDefaultTasks()
.AddBuildServerIntegration()
.InstallTools(
new DotNetToolInstallation("GitVersion.Tool", "6.5.1"),
new DotNetToolInstallation("dotnet-reportgenerator-globaltool", "5.5.1"))
.Build()
.Run(args);
}
}
Loading