Some tips for Windows development and GitHub Actions

  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
  • It seems at some point the default shell for the "run" set command changed from cmd to powershell. If you're reading older examples, it may need a "shelL: cmd" added to the step if you're seeing syntax errors. For example:
    - name: Restore Nuget Packages
      run: "\"$\\MSBuild.exe\" -t:restore -p:RestorePackagesConfig=true -p:Configuration=Release $\\exampleapp\\exampleapp.sln"
      shell: cmd
    
  • A probably dangerous move, but if there's stuff you want to do to a github repository / team /etc based on triggers in github, you can install and use the PowerShellForGitHub Powershell module and use a Personal Access Token (and probably SSO "signing" it) and set it up as a GitHub Secret. For more details, see the Powershll and Github section below
  • 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