From 4d80c71f9269b3fa376dae33c6af18a695cda382 Mon Sep 17 00:00:00 2001 From: Amatsugu Date: Sat, 5 Jul 2025 21:09:01 -0400 Subject: [PATCH] Added version number --- .github/workflows/release.yaml | 1 + AobaClient/src/components/navbar.rs | 5 ++++- AobaServer/Dockerfile | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7927eca..f51b85e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,3 +34,4 @@ jobs: context: . push: true tags: git.kaisei.app/amatsugu/aoba:${{ env.VERSION }} + build-args: VERSION=${ env.VERSION } diff --git a/AobaClient/src/components/navbar.rs b/AobaClient/src/components/navbar.rs index 4b0e65b..9730c62 100644 --- a/AobaClient/src/components/navbar.rs +++ b/AobaClient/src/components/navbar.rs @@ -1,3 +1,5 @@ +use std::env; + use dioxus::prelude::*; use crate::{Route, contexts::AuthContext}; @@ -47,9 +49,10 @@ pub fn Widgets() -> Element { #[component] pub fn Utils() -> Element { let mut auth_context = use_context::(); - + let version = env::var("APP_VERSION").unwrap_or("DEBUG".into()); rsx! { div { class: "utils", + div { "{version}" } div { onclick: move |_| auth_context.logout(), "Logout" } } } diff --git a/AobaServer/Dockerfile b/AobaServer/Dockerfile index c48d222..c253157 100644 --- a/AobaServer/Dockerfile +++ b/AobaServer/Dockerfile @@ -24,7 +24,8 @@ RUN apt install -y protobuf-compiler libprotobuf-dev ffmpeg RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash RUN cargo binstall dioxus-cli --root /.cargo -y --force ENV PATH="/.cargo/bin:$PATH" - +ARG VERSION +ENV APP_VERSION=$VERSION # Create the final bundle folder. Bundle always executes in release mode with optimizations enabled RUN dx bundle --platform web @@ -56,7 +57,7 @@ RUN dotnet publish "./AobaServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish # This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) FROM base AS final WORKDIR /app + COPY --from=publish /app/publish . COPY --from=client-builder /bin/ffmpeg /bin/ffprobe /bin/ffplay /usr/bin/ - ENTRYPOINT ["dotnet", "AobaServer.dll"]