Browse Source

add version information (#15)

pull/16/head
Jason Dove 5 years ago committed by GitHub
parent
commit
04ab4ee60f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/workflows/release.yml
  2. 5
      Directory.Build.props
  3. 3
      Dockerfile
  4. 12
      ErsatzTV/Shared/MainLayout.razor
  5. 2
      docker-compose.yml

4
.github/workflows/release.yml

@ -42,8 +42,8 @@ jobs: @@ -42,8 +42,8 @@ jobs:
release_name_cli="ErsatzTV.CommandLine-$tag-${{ matrix.target }}"
# Build everything
dotnet publish ErsatzTV/ErsatzTV.csproj --framework net5.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name"
dotnet publish ErsatzTV.CommandLine/ErsatzTV.CommandLine.csproj --framework net5.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name_cli"
dotnet publish ErsatzTV/ErsatzTV.csproj --framework net5.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name" /p:InformationalVersion="${tag:1}-${{ matrix.target }}"
dotnet publish ErsatzTV.CommandLine/ErsatzTV.CommandLine.csproj --framework net5.0 --runtime "${{ matrix.target }}" -c Release -o "$release_name_cli" /p:InformationalVersion="${tag:1}-${{ matrix.target }}"
# Pack files
if [ "${{ matrix.target }}" == "win-x64" ]; then

5
Directory.Build.props

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<InformationalVersion>develop</InformationalVersion>
</PropertyGroup>
</Project>

3
Dockerfile

@ -26,7 +26,8 @@ COPY ErsatzTV.Core/. ./ErsatzTV.Core/ @@ -26,7 +26,8 @@ COPY ErsatzTV.Core/. ./ErsatzTV.Core/
COPY ErsatzTV.Core.Tests/. ./ErsatzTV.Core.Tests/
COPY ErsatzTV.Infrastructure/. ./ErsatzTV.Infrastructure/
WORKDIR /source/ErsatzTV
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained false --no-restore
ARG INFO_VERSION="unknown"
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained false --no-restore /p:InformationalVersion=${INFO_VERSION}
# final stage/image
FROM runtime-base

12
ErsatzTV/Shared/MainLayout.razor

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
@inherits LayoutComponentBase
@using System.Reflection
@inherits LayoutComponentBase
<MudThemeProvider Theme="_ersatzTvTheme"/>
<MudDialogProvider DisableBackdropClick="true"/>
@ -33,6 +34,11 @@ @@ -33,6 +34,11 @@
<MudNavLink Href="/schedules">Schedules</MudNavLink>
<MudNavLink Href="/playouts">Playouts</MudNavLink>
<MudNavLink Href="/system/logs">Logs</MudNavLink>
<MudDivider Class="my-6" DividerType="DividerType.Middle" />
<MudContainer Style="text-align: right" Class="mr-6">
<MudText Typo="Typo.body2">ErsatzTV Version</MudText>
<MudText Typo="Typo.body2" Color="Color.Info">@InfoVersion</MudText>
</MudContainer>
</MudNavMenu>
</MudDrawer>
<MudMainContent>
@ -43,7 +49,9 @@ @@ -43,7 +49,9 @@
</MudLayout>
@code {
bool _drawerOpen = true;
private static readonly string InfoVersion = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? "unknown";
private bool _drawerOpen = true;
private void DrawerToggle() => _drawerOpen = !_drawerOpen;

2
docker-compose.yml

@ -4,6 +4,8 @@ services: @@ -4,6 +4,8 @@ services:
ersatztv:
build:
context: .
args:
INFO_VERSION: "docker-compose-develop"
ports:
- "8409:8409"
volumes:

Loading…
Cancel
Save