From 0fe293bcd2a1dfea669fe0c038612770e49484bd Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sat, 15 Aug 2026 22:18:03 +0100 Subject: [PATCH 1/9] forgejo/ci: run build in pazof/yavsc-build-env container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le workflow buildAndTest tournait sur un runner nu debian-latest avec setup-dotnet@v5 pour la SDK 10.0.x. Restore échouait car cet environnement n'a ni la source NuGet interne (isn.pschneider.fr) ni les workloads Android configurés, contrairement à l'image pazof/yavsc-build-env utilisée par le Dockerfile. Bascule le job sur un runner labelisé docker avec l'image debian12-dotnet10-android36-v1 directement. Le step setup-dotnet devient inutile (l'image a déjà la SDK 10.0), le restore partage la même config que le Dockerfile. Refs l'image cible par ARG BUILD_ENV_TAG=debian12-dotnet10-android36-v1. --- .forgejo/workflows/buildAndTest.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml index c10b4439..12c47ac2 100644 --- a/.forgejo/workflows/buildAndTest.yml +++ b/.forgejo/workflows/buildAndTest.yml @@ -37,14 +37,10 @@ jobs: build: - runs-on: debian-latest + runs-on: docker://pazof/yavsc-build-env:debian12-dotnet10-android36-v1 steps: - uses: actions/checkout@v6 - - name: Setup .NET - uses: actions/setup-dotnet@v5 - with: - dotnet-version: 10.0.x - name: Restore dependencies run: dotnet restore - name: Build -- 2.47.3 From e165e7bb61d02c2afd85ae6334262c945be07112 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 12:49:50 +0100 Subject: [PATCH 2/9] dotnet-android-build-image: pin to --- .gitmodules | 3 +++ external/dotnet-android-build-image | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 external/dotnet-android-build-image diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..6595fa7d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "external/dotnet-android-build-image"] + path = external/dotnet-android-build-image + url = git@forgejo.pschneider.fr:notazof/dotnet-android-build-image.git diff --git a/external/dotnet-android-build-image b/external/dotnet-android-build-image new file mode 160000 index 00000000..0695a6c1 --- /dev/null +++ b/external/dotnet-android-build-image @@ -0,0 +1 @@ +Subproject commit 0695a6c1fea6508f1a88f7ad0ad9cb93733aa52d -- 2.47.3 From 4ac8e14ba928954e3eaaa6df1a179e1f3a86801b Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 13:03:17 +0100 Subject: [PATCH 3/9] run on docker --- .forgejo/workflows/buildAndTest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml index 12c47ac2..28fee837 100644 --- a/.forgejo/workflows/buildAndTest.yml +++ b/.forgejo/workflows/buildAndTest.yml @@ -37,7 +37,7 @@ jobs: build: - runs-on: docker://pazof/yavsc-build-env:debian12-dotnet10-android36-v1 + runs-on: docker steps: - uses: actions/checkout@v6 -- 2.47.3 From 380b5d12c86dfa3dfc1aaaf7eee5569fae47566f Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 13:15:10 +0100 Subject: [PATCH 4/9] ci: replace actions/checkout with manual git clone (image has no node) The pazof/yavsc-build-env:debian12-dotnet10-android36-v1 image only ships .NET 10 SDK + Android SDK + JDK 17, no Node. actions/checkout@v6 requires Node, so the job failed with 'exec: node not found'. Replace actions/checkout with a direct git clone over HTTPS (Forgejo anonymous is enabled), and init submodules recursively. Also drop the bogus docker://image:tag runs-on: matcher, use just 'docker' to match the runner's declared label name. --- .forgejo/workflows/buildAndTest.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml index 28fee837..e0b63433 100644 --- a/.forgejo/workflows/buildAndTest.yml +++ b/.forgejo/workflows/buildAndTest.yml @@ -40,10 +40,19 @@ jobs: runs-on: docker steps: - - uses: actions/checkout@v6 + - name: Clone yavsc + run: | + cd "$RUNNER_WORKSPACE" + git clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" \ + https://forgejo.pschneider.fr/notazof/yavsc.git _src + cd _src + git submodule update --init --recursive --depth 1 - name: Restore dependencies + working-directory: ${{ runner.workspace }}/_src run: dotnet restore - name: Build + working-directory: ${{ runner.workspace }}/_src run: dotnet build --no-restore - name: Test + working-directory: ${{ runner.workspace }}/_src run: dotnet test --no-build --verbosity normal -- 2.47.3 From 7370f48aac750def991eb0ded4b8259dc1a38928 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 13:22:56 +0100 Subject: [PATCH 5/9] ci: clone via GITHUB_REF instead of GITHUB_REF_NAME In pull_request context, GITHUB_REF_NAME is the PR number ('17'), not the source branch. Cloning --branch 17 fails with 'Could not find remote branch 17 to clone'. Use GITHUB_REF (refs/pull/N/head in PR context, refs/heads/ in push context) and fetch + checkout FETCH_HEAD. workflow_dispatch falls back to the default branch. --- .forgejo/workflows/buildAndTest.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml index e0b63433..7a19e803 100644 --- a/.forgejo/workflows/buildAndTest.yml +++ b/.forgejo/workflows/buildAndTest.yml @@ -43,9 +43,12 @@ jobs: - name: Clone yavsc run: | cd "$RUNNER_WORKSPACE" - git clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" \ - https://forgejo.pschneider.fr/notazof/yavsc.git _src + git clone https://forgejo.pschneider.fr/notazof/yavsc.git _src cd _src + if [ -n "${GITHUB_REF:-}" ]; then + git fetch --depth 1 origin "$GITHUB_REF" + git checkout FETCH_HEAD + fi git submodule update --init --recursive --depth 1 - name: Restore dependencies working-directory: ${{ runner.workspace }}/_src -- 2.47.3 From 86e59ad1c10ed26d6da95ee227632b52f8c5c434 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 13:26:12 +0100 Subject: [PATCH 6/9] submodule: switch URL from SSH to HTTPS for forgejo anonymous access The runner container does not have an SSH client, and even if it did, no key is configured for it. Forgejo Actions must reach the submodule over HTTPS with anonymous read access (which is now enabled on the Forgejo instance). Use 'git submodule sync --recursive' on the developer side after checkout to propagate the URL change to .git/modules/. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 6595fa7d..eadf3c7f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "external/dotnet-android-build-image"] path = external/dotnet-android-build-image - url = git@forgejo.pschneider.fr:notazof/dotnet-android-build-image.git + url = https://forgejo.pschneider.fr/notazof/dotnet-android-build-image.git -- 2.47.3 From 5f50135c7ff5d9d9081c6e34273d8f956f31d283 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 13:27:36 +0100 Subject: [PATCH 7/9] ci: drop working-directory, cd into /src/_src explicitly forgejo-runner v13 does not interpolate ${{ runner.workspace }} in working-directory: (or ignores the field entirely for docker containers), so the container tried to chdir to '/_src' (literally) which does not exist. The image WORKDIR is /src, so clone directly into /src/_src and cd into it at the start of each step. Adds an echo of the checkout SHA + branch state for visibility in the log. --- .forgejo/workflows/buildAndTest.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml index 7a19e803..2c0137bd 100644 --- a/.forgejo/workflows/buildAndTest.yml +++ b/.forgejo/workflows/buildAndTest.yml @@ -42,7 +42,7 @@ jobs: steps: - name: Clone yavsc run: | - cd "$RUNNER_WORKSPACE" + cd /src git clone https://forgejo.pschneider.fr/notazof/yavsc.git _src cd _src if [ -n "${GITHUB_REF:-}" ]; then @@ -50,12 +50,10 @@ jobs: git checkout FETCH_HEAD fi git submodule update --init --recursive --depth 1 + echo "Checked out at $(git rev-parse HEAD) on $(git branch --show-current 2>/dev/null || echo detached HEAD)" - name: Restore dependencies - working-directory: ${{ runner.workspace }}/_src - run: dotnet restore + run: cd /src/_src && dotnet restore - name: Build - working-directory: ${{ runner.workspace }}/_src - run: dotnet build --no-restore + run: cd /src/_src && dotnet build --no-restore - name: Test - working-directory: ${{ runner.workspace }}/_src - run: dotnet test --no-build --verbosity normal + run: cd /src/_src && dotnet test --no-build --verbosity normal -- 2.47.3 From 94012c51ab49ef0026e3e331ab48751c6ed7c880 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 13:35:44 +0100 Subject: [PATCH 8/9] nuget: add NuGet.config pointing at isn.pschneider.fr The yavsc solution depends on HigginsSoft.IdentityServer8.* 8.1.0-alpha.*, which is only published on the internal feed https://isn.pschneider.fr. Public nuget.org has 8.0.4 as the nearest version, so every project that uses IdentityServer8 (Yavsc.Org, Yavsc.Api, Yavsc.Blogs, Yavsc.Server, cli, Yavsc.Org.Tests, Yavsc.Blogs.Tests) fails with NU1102 on restore. Both feeds are reachable anonymously, so listing isn first and nuget.org second in a project-level config restores everything without credentials. The CI runner on forgejo now sees the same sources as a local clone. --- NuGet.config | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 NuGet.config diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 00000000..c601d09b --- /dev/null +++ b/NuGet.config @@ -0,0 +1,23 @@ + + + + + + + + + -- 2.47.3 From cc50a8bbc8133ddb543b26bdc857604c7ef74c3e Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 16 Aug 2026 13:39:53 +0100 Subject: [PATCH 9/9] ci: unshallow clone for GitVersion GitVersion.MsBuild fails on shallow clones ('Repository is a shallow clone. Git repositories must contain the full history.') because it walks the git log to compute the SemVer version. Drop --depth 1 from both the PR ref fetch and the submodule update so the runner's working tree has full history. The repo is small enough that the cost is negligible. --- .forgejo/workflows/buildAndTest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml index 2c0137bd..9b3403db 100644 --- a/.forgejo/workflows/buildAndTest.yml +++ b/.forgejo/workflows/buildAndTest.yml @@ -46,10 +46,10 @@ jobs: git clone https://forgejo.pschneider.fr/notazof/yavsc.git _src cd _src if [ -n "${GITHUB_REF:-}" ]; then - git fetch --depth 1 origin "$GITHUB_REF" + git fetch origin "$GITHUB_REF" git checkout FETCH_HEAD fi - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive echo "Checked out at $(git rev-parse HEAD) on $(git branch --show-current 2>/dev/null || echo detached HEAD)" - name: Restore dependencies run: cd /src/_src && dotnet restore -- 2.47.3