From e7a4fe6c1e33551e80b701a78b1050a0d499a3a7 Mon Sep 17 00:00:00 2001 From: wanghu Date: Wed, 2 Sep 2026 11:32:18 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E8=87=AA=E5=8A=A8=E5=AE=89=E8=A3=85=20.N?= =?UTF-8?q?ET=208=20SDK=EF=BC=88runner=20=E9=95=9C=E5=83=8F=E6=97=A0=20dot?= =?UTF-8?q?net=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker.gitea.com/runner-images 未预装 dotnet,加 dotnet-install.sh 步骤。 --- .gitea/workflows/ci.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index a8f7edf..aefe9ab 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -18,7 +18,15 @@ jobs: rm -rf /tmp/src - name: 确认 dotnet SDK - run: dotnet --version + run: | + if ! command -v dotnet >/dev/null 2>&1; then + echo "dotnet 不存在,安装 .NET 8 SDK..." + curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh + chmod +x /tmp/dotnet-install.sh + /tmp/dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet + ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet + fi + dotnet --version - name: Restore run: dotnet restore BasePlatformDotnet/yh-platform-net.sln @@ -47,7 +55,15 @@ jobs: rm -rf /tmp/src - name: 确认 dotnet SDK - run: dotnet --version + run: | + if ! command -v dotnet >/dev/null 2>&1; then + echo "dotnet 不存在,安装 .NET 8 SDK..." + curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh + chmod +x /tmp/dotnet-install.sh + /tmp/dotnet-install.sh --channel 8.0 --install-dir /usr/share/dotnet + ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet + fi + dotnet --version - name: Pack run: dotnet pack BasePlatformDotnet/yh-platform-net.sln -c Release -o BasePlatformDotnet/artifacts