From a68287d84735402234e00a6c4211ca232dd3dd0d Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 2 Feb 2026 00:39:06 +0000 Subject: [PATCH] Dockerfile & actions --- .Dockerfile.swp | Bin 0 -> 12288 bytes .forgejo/workflows/buildAndTest.yml | 53 ++++++++++++++ Directory.Packages.props | 12 ++-- Dockerfile | 25 +++++++ index.html | 96 +++++++++++++++++++++++++ src/Yavsc.Server/Yavsc.Server.csproj | 2 +- src/Yavsc/Helpers/AsciiDocTagHelper.cs | 6 +- src/Yavsc/Yavsc.csproj | 3 +- src/cli/cli.csproj | 2 +- test/yavscTests/yavscTests.csproj | 2 +- yavsc.sln | 3 +- 11 files changed, 190 insertions(+), 14 deletions(-) create mode 100644 .Dockerfile.swp create mode 100644 .forgejo/workflows/buildAndTest.yml create mode 100644 Dockerfile create mode 100644 index.html diff --git a/.Dockerfile.swp b/.Dockerfile.swp new file mode 100644 index 0000000000000000000000000000000000000000..9c48655a24eb5314f038c3c5d7cc06e04d9cf019 GIT binary patch literal 12288 zcmeI&zi-n(6bJBYr!o`}NQ~%cBQe=d06`lmLugWnNR!A-Kovr8wlB>Q+jqJ<16k-F z0V9HmjTHtq1|;nWr%?a}jw_Jap|i3$xO$~h&Py#XU83jD4UStC*P{Rmpa2S>01BW03ZMWAoFDCF_27gC?PN6A@}@1v+q%KLJ0It_nWV=B)WdBfN~raGdq+zsg-UHTJ1)!UGJ}V{eKXe zXnc^5);H<&Z9u0ZYn7>b-nOu#EI8<1Xgbk!KfD*jGVl^6QqQnN#oTy)v)vOs3Gs4UWL>UNraAWbc-;+l#C-ju1r)n)>7&uX*E#gHRaE95u99Qcp` literal 0 HcmV?d00001 diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml new file mode 100644 index 00000000..cda246cc --- /dev/null +++ b/.forgejo/workflows/buildAndTest.yml @@ -0,0 +1,53 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net +name: Dotnet build and test + +on: + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + type: choice + options: + - info + - warning + - debug + tags: + description: 'Test scenario tags' + required: false + type: boolean + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + log-the-inputs: + runs-on: debian-latest + steps: + - run: | + echo "Log level: $LEVEL" + echo "Tags: $TAGS" + echo "Environment: $ENVIRONMENT" + env: + LEVEL: ${{ inputs.logLevel }} + TAGS: ${{ inputs.tags }} + + build: + + runs-on: debian-latest + + steps: + - uses: actions/checkout@v6 + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 9.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/Directory.Packages.props b/Directory.Packages.props index f193faac..bb1ab729 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,7 +3,6 @@ true - @@ -12,11 +11,12 @@ - - - - + + + + + @@ -58,4 +58,4 @@ - + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..33b19e95 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# syntax=docker/dockerfile:1 +# Learn about building .NET container images: +# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build +ARG TARGETARCH=amd64 + +WORKDIR /source + +# Copy project file and restore as distinct layers +COPY --link src src +COPY --link Directory.Packages.props . + +RUN dotnet nuget add source https://isn.pschneider.fr/v3/index.json +RUN dotnet restore -a $TARGETARCH src/Yavsc/Yavsc.csproj + +# Copy source code and publish app +RUN dotnet publish -a $TARGETARCH --no-restore -o /app src/Yavsc/Yavsc.csproj + +# Runtime stage +FROM mcr.microsoft.com/dotnet/runtime:10.0-alpine +WORKDIR /app +COPY --link --from=build /app . +USER $APP_UID +ENTRYPOINT ["./Yavsc"] + diff --git a/index.html b/index.html new file mode 100644 index 00000000..c6ffa60b --- /dev/null +++ b/index.html @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + diff --git a/src/Yavsc.Server/Yavsc.Server.csproj b/src/Yavsc.Server/Yavsc.Server.csproj index c2b86005..44632c58 100644 --- a/src/Yavsc.Server/Yavsc.Server.csproj +++ b/src/Yavsc.Server/Yavsc.Server.csproj @@ -29,4 +29,4 @@ - + \ No newline at end of file diff --git a/src/Yavsc/Helpers/AsciiDocTagHelper.cs b/src/Yavsc/Helpers/AsciiDocTagHelper.cs index 5dd46070..f5ce87c5 100644 --- a/src/Yavsc/Helpers/AsciiDocTagHelper.cs +++ b/src/Yavsc/Helpers/AsciiDocTagHelper.cs @@ -1,4 +1,4 @@ -using System.Text.Encodings.Web; + using System.Web; using AsciiDocSharp; using AsciiDocSharp.Converters.Html; @@ -34,7 +34,9 @@ namespace Yavsc.Helpers } } } - var processor = new AsciiDocProcessor(); + var processor = new AsciiDocProcessor( + + ); var htmlConverter = new HtmlDocumentConverter(); var document = processor.ParseFromText(text); diff --git a/src/Yavsc/Yavsc.csproj b/src/Yavsc/Yavsc.csproj index 8daeabc4..fa83037c 100644 --- a/src/Yavsc/Yavsc.csproj +++ b/src/Yavsc/Yavsc.csproj @@ -20,7 +20,6 @@ - @@ -51,4 +50,4 @@ - + \ No newline at end of file diff --git a/src/cli/cli.csproj b/src/cli/cli.csproj index e22ffe68..33746cc8 100644 --- a/src/cli/cli.csproj +++ b/src/cli/cli.csproj @@ -16,4 +16,4 @@ - + \ No newline at end of file diff --git a/test/yavscTests/yavscTests.csproj b/test/yavscTests/yavscTests.csproj index a99fe336..dfe5352a 100644 --- a/test/yavscTests/yavscTests.csproj +++ b/test/yavscTests/yavscTests.csproj @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/yavsc.sln b/yavsc.sln index 9b1286a7..8c068dd9 100644 --- a/yavsc.sln +++ b/yavsc.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 @@ -24,6 +24,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution items", "{9EB76B06-CA8E-4211-A16D-6646ED584311}" ProjectSection(SolutionItems) = preProject Directory.Packages.props = Directory.Packages.props + Directory.Packages.props = Directory.Packages.props EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cli", "src\cli\cli.csproj", "{7311313C-1837-420D-9AB2-E743AF78592A}"