feat: Add GitHub Actions automated build workflow#45
Conversation
Co-authored-by: BlameTwo <65759143+BlameTwo@users.noreply.github.com> Agent-Logs-Url: https://github.com/HaiyuGame/Haiyu/sessions/a064256e-fd86-483e-bbfe-550c83b684f0
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions CI build pipeline for the WinUI3/.NET 10 Haiyu app so pushes/PRs (and releases) automatically produce a publish output artifact.
Changes:
- Introduces a new
Buildworkflow triggered on push/PR tomain/masterandrelease: published. - Restores and publishes
src/WutheringWavesTool/Haiyu.csprojusing the existingwin-x64publish profile. - Uploads the publish output directory as a
Haiyuworkflow artifact with minimalcontents: readpermissions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: Haiyu | ||
| path: ${{ env.PUBLISH_DIR }} |
There was a problem hiding this comment.
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.
| path: ${{ env.PUBLISH_DIR }} | |
| path: ${{ env.PUBLISH_DIR }} | |
| if-no-files-found: error |
|
|
||
| - name: Restore | ||
| run: dotnet restore ${{ env.PROJECT_PATH }} -p:Platform=x64 | ||
|
|
There was a problem hiding this comment.
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.
| - name: Test | |
| run: dotnet test |
| run: dotnet restore ${{ env.PROJECT_PATH }} -p:Platform=x64 | ||
|
|
||
| - name: Publish | ||
| run: dotnet publish ${{ env.PROJECT_PATH }} -p:PublishProfile=win-x64 |
There was a problem hiding this comment.
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.
| run: dotnet publish ${{ env.PROJECT_PATH }} -p:PublishProfile=win-x64 | |
| run: dotnet publish ${{ env.PROJECT_PATH }} -p:PublishProfile=win-x64 --no-restore |
No CI build workflow existed for the Haiyu WinUI3/.NET 10 app — only MirrorChyan release-upload workflows were present.
Changes
.github/workflows/build.yml— new CI/CD workflow:main/masterand onrelease: publishedwindows-latestrunner (required for WinUI3 + Native AOT)-p:Platform=x64, publishes via the existingwin-x64publish profilebin/win-x64/publish/as aHaiyuartifactpermissions: contents: readscoped to minimum required