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