Implemented Versioning
This commit is contained in:
parent
44c4398fe4
commit
f5d2f70692
11
.github/workflows/docker.yml
vendored
11
.github/workflows/docker.yml
vendored
|
@ -22,8 +22,15 @@ jobs:
|
||||||
images: ${{ env.IMAGE_NAME }}
|
images: ${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
|
labels: |
|
||||||
|
maintainer=Mia Rose Winter
|
||||||
|
org.opencontainers.image.title=Wave
|
||||||
|
org.opencontainers.image.url=https://github.com/miawinter98/wave
|
||||||
|
org.opencontainers.image.source=https://github.com/miawinter98/wave
|
||||||
|
org.opencontainers.image.description=The Collaborative Open Source Blogging Engine
|
||||||
|
org.opencontainers.image.vendor=Winter Software
|
||||||
|
org.opencontainers.image.licenses=MIT
|
||||||
|
|
||||||
- name: Log into the Container registry
|
- name: Log into the Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
|
@ -42,3 +49,5 @@ jobs:
|
||||||
file: Wave/Dockerfile
|
file: Wave/Dockerfile
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
build-args: |
|
||||||
|
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
|
||||||
|
|
|
@ -87,11 +87,14 @@
|
||||||
|
|
||||||
<div class="bg-base-200 p-4 h-full flex flex-col gap-4 w-48 lg:w-64">
|
<div class="bg-base-200 p-4 h-full flex flex-col gap-4 w-48 lg:w-64">
|
||||||
<NavMenu />
|
<NavMenu />
|
||||||
|
<a class="absolute left-2 right-2 bottom-2 text-center text-slate-400" href="https://github.com/miawinter98/wave">@Version</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
[CascadingParameter(Name = "Version")]
|
||||||
|
private string Version { get; set; } = string.Empty;
|
||||||
[CascadingParameter(Name = "UserTheme")]
|
[CascadingParameter(Name = "UserTheme")]
|
||||||
private string? UserTheme { get; set; }
|
private string? UserTheme { get; set; }
|
||||||
[CascadingParameter]
|
[CascadingParameter]
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
</Authorized>
|
</Authorized>
|
||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="menu gap-2" aria-label="Account">
|
<ul class="menu gap-2 mb-2" aria-label="Account">
|
||||||
<AuthorizeView>
|
<AuthorizeView>
|
||||||
<Authorized>
|
<Authorized>
|
||||||
<li class="flex gap-2">
|
<li class="flex gap-2">
|
||||||
|
|
|
@ -14,16 +14,26 @@ HEALTHCHECK --start-period=5s --start-interval=15s --interval=30s --timeout=30s
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
|
ARG VERSION=0.0.1
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["Wave/Wave.csproj", "Wave/"]
|
COPY ["Wave/Wave.csproj", "Wave/"]
|
||||||
RUN dotnet restore "./Wave/Wave.csproj"
|
RUN dotnet restore "./Wave/Wave.csproj"
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR "/src/Wave"
|
WORKDIR "/src/Wave"
|
||||||
RUN dotnet build "./Wave.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
RUN dotnet build "./Wave.csproj" \
|
||||||
|
-c $BUILD_CONFIGURATION \
|
||||||
|
-o /app/build \
|
||||||
|
-p:Version="${VERSION}"
|
||||||
|
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
RUN dotnet publish "./Wave.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
ARG VERSION=0.0.1
|
||||||
|
ARG VERSION_SUFFIX=
|
||||||
|
RUN dotnet publish "./Wave.csproj" \
|
||||||
|
-c $BUILD_CONFIGURATION \
|
||||||
|
-o /app/publish \
|
||||||
|
-p:UseAppHost=false \
|
||||||
|
-p:Version="${VERSION}"
|
||||||
|
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Reflection;
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
using Microsoft.AspNetCore.Components.Authorization;
|
||||||
using Microsoft.AspNetCore.Components.Server;
|
using Microsoft.AspNetCore.Components.Server;
|
||||||
using Microsoft.AspNetCore.DataProtection;
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
|
@ -18,6 +19,11 @@
|
||||||
using Wave.Services;
|
using Wave.Services;
|
||||||
using Wave.Utilities;
|
using Wave.Utilities;
|
||||||
|
|
||||||
|
string humanReadableVersion = Assembly.GetEntryAssembly()?
|
||||||
|
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?
|
||||||
|
.InformationalVersion.Split("+", 2)[0] ?? "unknown";
|
||||||
|
Console.WriteLine(@"Starting Wave " + humanReadableVersion);
|
||||||
|
|
||||||
var logMessages = new List<string>();
|
var logMessages = new List<string>();
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
@ -28,6 +34,7 @@
|
||||||
.AddIniFile( Path.Combine(FileSystemService.ConfigurationDirectory, "config.ini"), true, false)
|
.AddIniFile( Path.Combine(FileSystemService.ConfigurationDirectory, "config.ini"), true, false)
|
||||||
.AddXmlFile( Path.Combine(FileSystemService.ConfigurationDirectory, "config.xml"), true, false)
|
.AddXmlFile( Path.Combine(FileSystemService.ConfigurationDirectory, "config.xml"), true, false)
|
||||||
.AddEnvironmentVariables("WAVE_");
|
.AddEnvironmentVariables("WAVE_");
|
||||||
|
builder.Services.AddCascadingValue("Version", _ => humanReadableVersion);
|
||||||
|
|
||||||
builder.Services.AddRazorComponents().AddInteractiveServerComponents();
|
builder.Services.AddRazorComponents().AddInteractiveServerComponents();
|
||||||
builder.Services.AddControllers(options => {
|
builder.Services.AddControllers(options => {
|
||||||
|
|
2
Wave/wwwroot/css/main.min.css
vendored
2
Wave/wwwroot/css/main.min.css
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue