Skip to content

feat: Add GitHub Actions automated build workflow#45

Merged
BlameTwo merged 1 commit intomasterfrom
copilot/create-auto-build-configuration
Mar 23, 2026
Merged

feat: Add GitHub Actions automated build workflow#45
BlameTwo merged 1 commit intomasterfrom
copilot/create-auto-build-configuration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 23, 2026

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:
    • Triggers on push/PR to main/master and on release: published
    • windows-latest runner (required for WinUI3 + Native AOT)
    • Installs .NET 10.0.x SDK, restores with -p:Platform=x64, publishes via the existing win-x64 publish profile
    • Uploads bin/win-x64/publish/ as a Haiyu artifact
    • permissions: contents: read scoped to minimum required
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:
      - uses: actions/checkout@v4
      - uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '10.0.x'
      - run: dotnet restore ${{ env.PROJECT_PATH }} -p:Platform=x64
      - run: dotnet publish ${{ env.PROJECT_PATH }} -p:PublishProfile=win-x64
      - uses: actions/upload-artifact@v4
        with:
          name: Haiyu
          path: ${{ env.PUBLISH_DIR }}

Co-authored-by: BlameTwo <65759143+BlameTwo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/HaiyuGame/Haiyu/sessions/a064256e-fd86-483e-bbfe-550c83b684f0
@BlameTwo BlameTwo marked this pull request as ready for review March 23, 2026 03:28
Copilot AI review requested due to automatic review settings March 23, 2026 03:28
@BlameTwo BlameTwo merged commit d5bedaf into master Mar 23, 2026
3 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Build workflow triggered on push/PR to main/master and release: published.
  • Restores and publishes src/WutheringWavesTool/Haiyu.csproj using the existing win-x64 publish profile.
  • Uploads the publish output directory as a Haiyu workflow artifact with minimal contents: read permissions.

💡 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 }}
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.

- 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.
run: dotnet restore ${{ env.PROJECT_PATH }} -p:Platform=x64

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants