From 3c4d1e666bb6126164d24f084b868a54ae838108 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Sun, 23 Aug 2026 12:20:04 -0700 Subject: [PATCH] Adds Six Labors license handling and expiry checks --- .github/workflows/run-tests.yml | 5 ++++- .gitignore | 5 ++++- src/.dockerignore | 11 ++++++++++- src/Lumina.Domain/Lumina.Domain.csproj | 24 ++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9548c877..1b43726a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,9 +18,12 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: '10.0.x' + - name: Restore Six Labors license + shell: bash + run: printf '%s\n' "${{ secrets.SIXLABORS_LICENSE_KEY }}" > src/Lumina.Domain/sixlabors.lic - name: Restore dependencies run: dotnet restore src/Lumina.sln - name: Build - run: dotnet build src/Lumina.sln --no-restore + run: dotnet build src/Lumina.sln --no-restore -p:SixLaborsLicenseEnforceBuild=true - name: Run tests run: dotnet test src/Lumina.sln --no-build --verbosity normal diff --git a/.gitignore b/.gitignore index 12452e6a..9417a957 100644 --- a/.gitignore +++ b/.gitignore @@ -71,4 +71,7 @@ $RECYCLE.BIN/ AGENTS.[Mm][Dd] agents.[Mm][Dd] SKILL.[Mm][Dd] -skill.[Mm][Dd] \ No newline at end of file +skill.[Mm][Dd] + +# Licenses +sixlabors.lic diff --git a/src/.dockerignore b/src/.dockerignore index fe1152bd..17a5ec5e 100644 --- a/src/.dockerignore +++ b/src/.dockerignore @@ -27,4 +27,13 @@ README.md !.git/HEAD !.git/config !.git/packed-refs -!.git/refs/heads/** \ No newline at end of file +!.git/refs/heads/** + +# AI +**/AGENTS.[Mm][Dd] +**/agents.[Mm][Dd] +**/SKILL.[Mm][Dd] +**/skill.[Mm][Dd] + +# Six Labors license key file: must always be present for build-time license validation +!**/sixlabors.lic diff --git a/src/Lumina.Domain/Lumina.Domain.csproj b/src/Lumina.Domain/Lumina.Domain.csproj index 0f10cbfa..1fafed85 100644 --- a/src/Lumina.Domain/Lumina.Domain.csproj +++ b/src/Lumina.Domain/Lumina.Domain.csproj @@ -23,4 +23,28 @@ + + + <_SixLaborsLic>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)sixlabors.lic')) + <_SixLaborsExpiryStart>$([MSBuild]::Add($(_SixLaborsLic.IndexOf('ExpiryDateUtc=')), 14)) + <_SixLaborsExpiryEnd>$(_SixLaborsLic.IndexOf(';', $(_SixLaborsExpiryStart))) + <_SixLaborsExpiryLength>$([MSBuild]::Subtract($(_SixLaborsExpiryEnd), $(_SixLaborsExpiryStart))) + <_SixLaborsExpiry>$(_SixLaborsLic.Substring($(_SixLaborsExpiryStart), $(_SixLaborsExpiryLength))) + <_SixLaborsExpiryTicks>$([System.DateTime]::Parse($(_SixLaborsExpiry)).Ticks) + <_SixLaborsNowTicks>$([System.DateTime]::UtcNow.Ticks) + <_SixLaborsLicenseCheckWindows> + <_SixLaborsLicenseCheckLinux>/dev/null 2>&1; then es="$(date -d "$e" +%s)"; else es="$(date -j -f "%Y-%m-%dT%H:%M:%S" "${e%%.*}" +%s)"; fi; if [ -z "$es" ]; then exit 0; fi; now="$(date +%s)"; d=$(( (es-now)/86400 )); if [ "$d" -ge 0 ] && [ "$d" -le 30 ]; then echo "WARNING: Six Labors license expires in ${d} days on ${e}. Email licensing.sixlabors.com now - renewal takes a few days. Update the SIXLABORS_LICENSE_KEY GitHub secret and src/Lumina.Domain/sixlabors.lic when you receive the new key."; fi; true' + ]]> + + + + + + +