Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build

on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
release:
types: [published]

env:
PROJECT_PATH: src/WutheringWavesTool/Haiyu.csproj
PUBLISH_DIR: src/WutheringWavesTool/bin/win-x64/publish

jobs:
build:
runs-on: windows-latest
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Restore
run: dotnet restore ${{ env.PROJECT_PATH }} -p:Platform=x64

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow publishes but never runs the repo’s unit tests (there is a test project under src/Project.Test). Consider adding a dotnet test step (typically after restore/build) so CI catches regressions before publishing artifacts.

Suggested change
- name: Test
run: dotnet test

Copilot uses AI. Check for mistakes.
- name: Publish
run: dotnet publish ${{ env.PROJECT_PATH }} -p:PublishProfile=win-x64
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotnet publish will perform an implicit restore by default, so the separate Restore step can be redundant and slow. If you want to keep the explicit restore, consider adding --no-restore to the publish command to avoid doing dependency resolution twice.

Suggested change
run: dotnet publish ${{ env.PROJECT_PATH }} -p:PublishProfile=win-x64
run: dotnet publish ${{ env.PROJECT_PATH }} -p:PublishProfile=win-x64 --no-restore

Copilot uses AI. Check for mistakes.

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Haiyu
path: ${{ env.PUBLISH_DIR }}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/upload-artifact defaults to only warning when the path matches no files, which can let the job succeed while producing no artifact if the publish output path ever changes. Consider setting if-no-files-found: error to fail fast when the publish directory is missing/empty.

Suggested change
path: ${{ env.PUBLISH_DIR }}
path: ${{ env.PUBLISH_DIR }}
if-no-files-found: error

Copilot uses AI. Check for mistakes.
Loading