Some tips for Windows development and GitHub Actions
- Be careful of calls that might end up needing user input! For example, make sure to run installers in a quiet/no prompt mode. The runner will wait for user feedback that won't come.
- I've had mixed luck with more windows-centric GitHub Actions. Feel free to explore the Marketplace, but you may find it easier to just call out to shell or powershell.
- By following some error messages, I figured out the "install path", at least at the moment, (see either the create-release-zip or build-and-test examples for more info on where this goes in the workflow yaml file).
jobs:
build:
env:
msbuild-path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin
vstest-path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\TestPlatform
- name: Restore Nuget Packages
run: "\"$\\MSBuild.exe\" -t:restore -p:RestorePackagesConfig=true -p:Configuration=Release $\\exampleapp\\exampleapp.sln"
shell: cmd
PowerShellForGitHub
The PowerShellForGitHub pages are pretty brief, but you can get a lot of information by using the Get-Help
cmdlet. For example:
Get-Help Set-GitHubAuthentication -ShowWindow
or just examples like
Get-Help Set-GitHubAuthentication -Examples