ci: 移除 GitHub actions 依赖,内网手动 clone + 系统 dotnet
内网无法访问 github.com,actions/checkout@v4 拉取失败导致 job 卡死。 改为与既有 build.yml 一致的手动 clone 本仓库方式,dotnet 用 runner 镜像预装。
This commit is contained in:
+19
-10
@@ -8,12 +8,17 @@ jobs:
|
||||
build-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# 内网无 GitHub,不能用 actions/checkout@v4;手动 clone 本仓库(Gitea Actions 已注入 GITHUB_TOKEN)
|
||||
- name: 拉取源码(内网手动 clone)
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git clone --depth 1 --branch "$GITHUB_REF_NAME" "http://x-access-token:${GITHUB_TOKEN}@gitea.yunhaixingtong.com/${{ github.repository }}.git" /tmp/src
|
||||
cp -a /tmp/src/. .
|
||||
rm -rf /tmp/src
|
||||
|
||||
- name: Setup .NET 8
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
- name: 确认 dotnet SDK
|
||||
run: dotnet --version
|
||||
|
||||
- name: Restore
|
||||
run: dotnet restore BasePlatformDotnet/yh-platform-net.sln
|
||||
@@ -33,12 +38,16 @@ jobs:
|
||||
needs: build-test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: 拉取源码(无内网 GitHub)
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
git clone --depth 1 --branch "$GITHUB_REF_NAME" "http://x-access-token:${GITHUB_TOKEN}@gitea.yunhaixingtong.com/${{ github.repository }}.git" /tmp/src
|
||||
cp -a /tmp/src/. .
|
||||
rm -rf /tmp/src
|
||||
|
||||
- name: Setup .NET 8
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
- name: 确认 dotnet SDK
|
||||
run: dotnet --version
|
||||
|
||||
- name: Pack
|
||||
run: dotnet pack BasePlatformDotnet/yh-platform-net.sln -c Release -o BasePlatformDotnet/artifacts
|
||||
|
||||
Reference in New Issue
Block a user