From 00c463a48e3d56ce65db62ecdb85cf8bea4c3f41 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 c10b44395..12c47ac23 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 From befc08dcb8f2c25696b4129b94f425c454356dd1 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 000000000..6595fa7d6 --- /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 000000000..0695a6c1f --- /dev/null +++ b/external/dotnet-android-build-image @@ -0,0 +1 @@ +Subproject commit 0695a6c1fea6508f1a88f7ad0ad9cb93733aa52d From f0f921b9de6e1088bd5134a8053f8295f9f7e37d 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 12c47ac23..28fee8379 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 From 00ece4f21f266e38459e03d0f2aba04e64862eae 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 28fee8379..e0b63433b 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 From b168232c5b7610e99ba5ecd0bacd5a08cb8ebdce 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 e0b63433b..7a19e8039 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 From 4717cfb76e28b5ee1bd0d5f7d3f1c349054b1156 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 6595fa7d6..eadf3c7fc 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 From 8bfa9471480ef6cda98016de48166e374e375d17 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 7a19e8039..2c0137bd5 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 From 7a9b831c1a72ad01555e09a329e98b0b2aee1648 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 000000000..c601d09b5 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,23 @@ + + + + + + + + + From 19d5ff2ecb9c152c03d15b3ec6d30c127683ca84 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 2c0137bd5..9b3403dba 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