修改工作流

This commit is contained in:
yeziuku 2024-07-23 16:15:14 +08:00 committed by GitHub
parent 59f2edcac8
commit d8c08957a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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