Skip to content

Add GitHub Actions CI workflow using dotnet commands directly - #1

Merged
yangxiaobai945 merged 2 commits into
mainfrom
copilot/integrate-build-action-dotnet-command
Apr 7, 2026
Merged

Add GitHub Actions CI workflow using dotnet commands directly#1
yangxiaobai945 merged 2 commits into
mainfrom
copilot/integrate-build-action-dotnet-command

Conversation

Copilot AI commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

The repo had no CI workflow. The issue requests building via dotnet commands rather than invoking build.ps1.

Changes

  • .github/workflows/build.yml — new CI workflow that:
    • Runs on windows-latest (required for net8.0-windows / WinForms target)
    • Triggers on push/PR to main
    • Builds using dotnet directly, skipping build.ps1:
      - run: dotnet restore VisualKeyBoard.sln
      - run: dotnet build VisualKeyBoard.sln -c Release --no-restore
    • Sets permissions: contents: read for least-privilege token scoping

Copilot AI changed the title [WIP] Integrate build action without calling build.ps1 Add GitHub Actions CI workflow using dotnet commands directly Apr 7, 2026
Copilot AI requested a review from yangxiaobai945 April 7, 2026 15:35
@yangxiaobai945

Copy link
Copy Markdown
Owner

@copilot 合并这个 pr

Copilot AI commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot 合并这个 pr

合并 PR 需要仓库维护者手动操作,我无法直接执行合并。请在 GitHub 页面上点击 "Merge pull request" 按钮完成合并。

@yangxiaobai945
yangxiaobai945 marked this pull request as ready for review April 7, 2026 15:39
Copilot AI review requested due to automatic review settings April 7, 2026 15:39
@yangxiaobai945
yangxiaobai945 merged commit 640699d into main Apr 7, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

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 first GitHub Actions CI workflow to build the WinForms/.NET solution on Windows runners using dotnet CLI commands (instead of invoking build.ps1), providing basic PR/push validation on main.

Changes:

  • Introduces a new Build workflow running on windows-latest.
  • Restores and builds the solution in Release using dotnet restore + dotnet build --no-restore.
  • Scopes GITHUB_TOKEN permissions to contents: read.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to +28
- name: Restore dependencies
run: dotnet restore VisualKeyBoard.sln

- name: Build
run: dotnet build VisualKeyBoard.sln -c Release --no-restore

Copilot AI Apr 7, 2026

Copy link

Choose a reason for hiding this comment

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

The workflow builds VisualKeyBoard.sln, but the repo’s documented/automated build path prefers VisualKeyBoard.slnx when present (see build.ps1 and README). This can cause CI to build a different solution than local builds and will break if the .sln is ever removed or becomes out of sync. Consider using the .slnx file (or adding a small step to select .slnx when it exists, falling back to .sln), matching build.ps1’s behavior.

Suggested change
- name: Restore dependencies
run: dotnet restore VisualKeyBoard.sln
- name: Build
run: dotnet build VisualKeyBoard.sln -c Release --no-restore
- name: Select solution file
id: select-solution
shell: pwsh
run: |
if (Test-Path 'VisualKeyBoard.slnx') {
"solution=VisualKeyBoard.slnx" >> $env:GITHUB_OUTPUT
} else {
"solution=VisualKeyBoard.sln" >> $env:GITHUB_OUTPUT
}
- name: Restore dependencies
run: dotnet restore ${{ steps.select-solution.outputs.solution }}
- name: Build
run: dotnet build ${{ steps.select-solution.outputs.solution }} -c Release --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