Skip to content

Commit

Permalink
Some improvements to versioning, build-script and auto-updater
Browse files Browse the repository at this point in the history
  • Loading branch information
haefele committed Oct 15, 2023
1 parent 2fbf30a commit 4ef6944
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
uses: ncipollo/[email protected]
with:
artifacts: "${{ env.output_path }}/Chat Prisma.zip"
tag: "v${{ env.GitBuildVersionSimple }}"
tag: "v${{ env.GitBuildVersion }}"
3 changes: 2 additions & 1 deletion src/ChatPrisma/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ private IHostBuilder CreateHostBuilder(string[] args) => Microsoft.Extensions.Ho
.Configure(o =>
{
o.ApplicationName = "Chat Prisma";
o.ApplicationVersion = ThisAssembly.AssemblyInformationalVersion;
o.ApplicationVersion = ThisAssembly.AssemblyFileVersion;
o.CommitId = ThisAssembly.GitCommitId;
o.ContactName = "Daniel Häfele";
o.ContactEmailAddress = "[email protected]";
})
Expand Down
6 changes: 4 additions & 2 deletions src/ChatPrisma/Options/ApplicationOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;

namespace ChatPrisma.Options;

Expand All @@ -9,7 +9,9 @@ public class ApplicationOptions
[Required]
public string ApplicationVersion { get; set; } = default!;
[Required]
public string CommitId { get; set; } = default!;
[Required]
public string ContactName { get; set; } = default!;
[Required]
public string ContactEmailAddress { get; set; } = default!;
}
}
9 changes: 8 additions & 1 deletion src/ChatPrisma/Views/About/AboutView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
<TextBlock Text="{Binding ApplicationName}" />
<TextBlock>
<Run Text="Version" />
<Run Text="{Binding ApplicationVersion}" />
<Run Text="{Binding ApplicationVersion}">
<Run.ToolTip>
<TextBlock>
<Run Text="Commit-ID:" />
<Run Text="{Binding CommitId}" />
</TextBlock>
</Run.ToolTip>
</Run>
</TextBlock>
</StackPanel>
</StackPanel>
Expand Down
5 changes: 4 additions & 1 deletion src/ChatPrisma/Views/About/AboutViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using ChatPrisma.Options;
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.Extensions.Options;
Expand All @@ -13,6 +13,9 @@ public partial class AboutViewModel(IOptions<ApplicationOptions> options) : Obse
[ObservableProperty]
private string _applicationVersion = options.Value.ApplicationVersion;

[ObservableProperty]
private string _commitId = options.Value.CommitId;

[ObservableProperty]
private string _contactName = options.Value.ContactName;

Expand Down

0 comments on commit 4ef6944

Please sign in to comment.