Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
with:
context: .
file: ./src/BuslyCLI.Console/Dockerfile
build-args: |
APP_VERSION=${{ inputs.version }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
3 changes: 3 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ Task("Compile")
.IsDependentOn("Clean")
.Does(() =>
{
var msBuildSettings = new DotNetMSBuildSettings()
.WithProperty("InformationalVersion", version);
DotNetBuild(solution, new DotNetBuildSettings
{
Configuration = configuration,
MSBuildSettings = msBuildSettings,
});
});

Expand Down
2 changes: 2 additions & 0 deletions src/BuslyCLI.Console/BuslyCLI.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<PackageIcon>busly-logo-128x128.png</PackageIcon>
<RepositoryUrl>https://github.com/TraGicCode/busly-cli</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<InformationalVersion>0.1.0</InformationalVersion>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/BuslyCLI.Console/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Use .NET 9 SDK to build
FROM mcr.microsoft.com/dotnet/sdk:10.0.100 AS build

ARG APP_VERSION=0.1.0
WORKDIR /src

COPY Directory.Build.props ./
Expand All @@ -21,7 +23,8 @@ RUN dotnet publish "./BuslyCLI.Console/BuslyCLI.Console.csproj" \
-p:PublishTrimmed=true \
-p:TrimMode=partial \
-p:EnableCompressionInSingleFile=true \
-p:SelfContained=true
-p:SelfContained=true \
-p:InformationalVersion=$APP_VERSION

# Use minimal runtime for smaller image size
FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-alpine AS final
Expand Down
4 changes: 3 additions & 1 deletion src/BuslyCLI.Console/Spectre/AppConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Reflection;
using BuslyCLI.Commands.Command;
using BuslyCLI.Commands.Demo;
using BuslyCLI.Commands.Event;
Expand All @@ -14,7 +15,8 @@ public static Action<IConfigurator> GetSpectreCommandConfiguration()
{
config.SetApplicationName("busly");
// TODO: Allow this to get set via the CLI version
config.SetApplicationVersion("1.0.0");
var assembly = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>();
config.SetApplicationVersion(assembly.InformationalVersion);
config.AddBranch("transport", transport =>
{
transport.SetDescription("Manage transport configurations.");
Expand Down