From d8c08957a440f1b054704cb80e71b0578130b682 Mon Sep 17 00:00:00 2001 From: yeziuku <53083103+yeziuku@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:15:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index e04768b..01c7446 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,4 +1,4 @@ -# This workflow will build a .NET project +# This workflow will build a .NET project and push the built files to the latest branch # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net name: .NET @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for all branches - name: Setup .NET uses: actions/setup-dotnet@v3 with: @@ -26,3 +28,17 @@ jobs: run: dotnet build --no-restore - name: Test run: dotnet test --no-build --verbosity normal + - name: Archive build output + run: | + mkdir -p build_output + cp -r ./bin/Debug/net8.0/* build_output/ + - name: Commit and push to latest + if: success() + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git checkout latest || git checkout -b latest + cp -r build_output/* . + git add . + git commit -m "Update build output from master" + git push origin latest