You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-11
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@ This action sets up a [.NET CLI](https://github.com/dotnet/sdk) environment for
10
10
11
11
> **Note**: GitHub hosted runners have some versions of the .NET SDK
12
12
preinstalled. Installed versions are subject to change. Please refer to the
13
-
documentation
14
-
[software installed on github hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software)
13
+
documentation:
14
+
[Software installed on github hosted runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software)
15
15
for .NET SDK versions that are currently available.
16
16
17
17
## Usage
@@ -27,6 +27,7 @@ steps:
27
27
dotnet-version: '3.1.x'
28
28
- run: dotnet build <my project>
29
29
```
30
+
> **Warning**: Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, **_the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version)_**. Please refer to the [documentation](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-software) for the currently preinstalled .NET SDK versions.
30
31
31
32
**Multiple version installation**:
32
33
```yml
@@ -40,8 +41,6 @@ steps:
40
41
5.0.x
41
42
- run: dotnet build <my project>
42
43
```
43
-
> **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.
44
-
45
44
## Supported version syntax
46
45
47
46
The `dotnet-version` input supports following syntax:
@@ -97,7 +96,31 @@ jobs:
97
96
uses: actions/setup-dotnet@v3
98
97
with:
99
98
dotnet-version: ${{ matrix.dotnet }}
100
-
- run: dotnet build <my project>
99
+
- name: Execute dotnet
100
+
run: dotnet build <my project>
101
+
```
102
+
>**Note**: Unless a concrete version is specified in the [`global.json`](https://learn.microsoft.com/en-us/dotnet/core/tools/global-json) file, the latest .NET version installed on the runner (including preinstalled versions) will be used [by default](https://learn.microsoft.com/en-us/dotnet/core/versions/selection#the-sdk-uses-the-latest-installed-version). To control this behavior you may want to use temporary `global.json` files:
103
+
104
+
**Matrix testing with temporary global.json creation**
When the `dotnet-version` input is used along with the `global-json-file` input, the `dotnet-version` output contains the version resolved from the `global.json`.
180
203
181
204
```yaml
182
205
- uses: actions/setup-dotnet@v3
183
-
id: cp310
206
+
id: stepid
184
207
with:
185
208
dotnet-version: |
186
209
3.1.422
187
210
5.0.408
188
211
global-json-file: "./global.json" # contains version 2.2.207
0 commit comments