Fix #58 clarifying intent and providing example usage [skip ci]

This commit is contained in:
Tim Heuer 2021-11-03 06:27:08 -07:00
parent c4a66a0e8a
commit c7c2934c87

View File

@ -1,16 +1,19 @@
# microsoft/setup-msbuild
You know how handy that 'Visual Studio Developer Command Prompt' is on your local machine? And how it adds several things to `PATH` to allow you to just issue commands like `msbuild` or otherwise? Use this action to setup similar flexibility in your Windows-based GitHub Actions runners. This will let you discover where the `MSBuild` tool is and automatically add it to the `PATH` environment variables for you so future steps in your Actions workflow can just initiate `msbuild` commands without knowing the full path.
This action will help discover where the `MSBuild` tool is and automatically add it to the `PATH` environment variables for you so future steps in your Actions workflow can just initiate `msbuild` commands without knowing the full path.
> Please note this tools is not to replicate the full 'Developer Command Prompt' but only discover and assist with MSBuild and not other tools like cl.exe
> Please note this tool does NOT add other Visual Studio tools (like VSTest, cl, cmake, or others) to `PATH`
## Usage
## Example Usage
```yml
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Build app for release
run: msbuild src\YourProjectFile.csproj -t:rebuild -verbosity:diag -property:Configuration=Release
```
## Specifying specific versions of Visual Studio
## Specifying specific versions of Visual Studio (optional)
You may have a situation where your Actions runner has multiple versions of Visual Studio and you need to find a specific version of the tool. Simply add the `vs-version` input to specify the range of versions to find. If looking for a specific version, specify the minimum and maximum versions as shown in the example below, which will look for just 16.4.
```yml
@ -33,7 +36,7 @@ This makes use of the vswhere tool which is a tool delivered by Microsoft to hel
```
## Notes on arguments
While the Action enables you to specify a `vswhere` path as well as a `vs-version`, these are more advanced options and when using GitHub-hosted runners you should not need these and is recommended you don't specify them. Using these require you to fully understand the runner environment, updates to the tools on the runner, and can cause failures if you are out of sync. For GitHub-hosted runners, omitting these arguments is the preferred usage.
While the Action enables you to specify a `vswhere` path as well as a `vs-version`, these are more advanced options and when using GitHub-hosted runners you should not need these and is recommended you don't specify them as they are optional. Using these require you to fully understand the runner environment, updates to the tools on the runner, and can cause failures if you are out of sync. For GitHub-hosted runners, omitting these arguments is the preferred usage.
## Building this repo
As with most GitHub Actions, this requires NodeJS development tools. After installing NodeJS, you can build this by executing: