ci: 自动安装 .NET 8 SDK(runner 镜像无 dotnet)
ci / build-test (push) Successful in 1m39s
ci / publish (push) Failing after 1m20s

docker.gitea.com/runner-images 未预装 dotnet,加 dotnet-install.sh 步骤。
This commit is contained in:
wanghu
2026-09-02 11:32:18 +08:00
parent be7112d08d
commit e7a4fe6c1e
+18 -2
View File
@@ -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