diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 18d6c0f..a8f7edf 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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 @@ -63,4 +72,4 @@ jobs: EOF - dotnet nuget push "BasePlatformDotnet/artifacts/*.nupkg" --source nexus-nuget --configfile nuget-push.config --api-key nexus + dotnet nuget push "BasePlatformDotnet/artifacts/*.nupkg" --source nexus-nuget --configfile nuget-push.config --api-key nexus \ No newline at end of file