A GitHub Action to set up a specific version of the .NET SDK in a workflow run.
- Sets up a .NET CLI environment for use in GitHub Actions
- Registers a problem matcher for error output
- Configures some .NET CLI related environment variables for best performance
- Supports all platforms (Linux, macOS, Windows)
Note
This action mainly provides a wrapper around the official actions/setup-dotnet action with a few additional quality-of-life improvements.
steps:
- name: .NET Setup
uses: zyactions/dotnet-setup@v1
with:
dotnet-version: '7.0.0'
steps:
- name: .NET Setup
uses: zyactions/dotnet-setup@v1
with:
dotnet-version: |
7.0.x
6.0.x
steps:
- name: .NET Setup
uses: zyactions/dotnet-setup@v1
with:
global-json-file: ./global.json
Allows to specify optional SDK version(s) to use. If not provided, will install global.json
version when available.
The dotnet-version
input supports following syntax:
A.B.C
installs exact version of .NET SDKA.B
orA.B.x
installs the latest patch version of .NET SDK on the given channel, including prerelease versions (preview
,rc
)A
orA.x
installs the latest minor version of the specified major tag, including prerelease versions (preview
,rc
)
Note
In case multiple versions are installed, the latest .NET version will be used by default unless another version is specified in the
global.json
file.In case both
dotnet-version
andglobal-json-file
inputs are used, versions from both inputs will be installed.
This input sets up the action to install the latest build of the specified quality in the channel.
The possible values of dotnet-quality
are:
daily
signed
validated
preview
ga
Note
The
dotnet-quality
input can be used only with .NET SDK version inA.B
,A.B.x
,A
andA.x
formats where the major version is higher than5
. In other cases, this input will be ignored.
Allows to specify the location of the global.json
, if it isn't located in the root of the repo.
Wheather to use the .NET problem matcher. The default problem matcher is automatically registered by the wrapped actions/setup-dotnet action. Setting problem-matcher
to false
will unregister it.
The dotnet-version
output contains the .NET SDK version installed by the action. Have a look at the dotnet-version
input to learn about precedence rules when specifying multiple versions and/or additionally using the global.json
file.
This action does use the following official GitHub Actions dependencies:
Versions follow the semantic versioning scheme.
.NET Setup Action is licensed under the MIT license.