ci: 自动安装 .NET 8 SDK(runner 镜像无 dotnet)
docker.gitea.com/runner-images 未预装 dotnet,加 dotnet-install.sh 步骤。
This commit is contained in:
+18
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user