-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathaction.yml
More file actions
58 lines (51 loc) · 2.23 KB
/
Copy pathaction.yml
File metadata and controls
58 lines (51 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Set up .NET
description: Sets up the .NET SDK.
inputs:
dotnet-version:
required: false
default: 10.0.302
description: Version of the .NET SDK to set up.
runs:
using: composite
steps:
- name: Setup Scripts
shell: pwsh
run: |
(Resolve-Path '${{ github.action_path }}/../../../Scripts').Path >> $Env:GITHUB_PATH
- name: Set Environment Variables
shell: pwsh
run: |
Set-GitHubEnv 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' 'true'
Set-GitHubEnv 'DOTNET_CLI_TELEMETRY_OPTOUT' 'true'
# This makes builds faster under Windows, see
# https://github.com/actions/setup-dotnet/issues/260#issuecomment-2516145018. Only GitHub-hosted standard (not
# larger) runners have such a D drive.
- name: Set DOTNET_INSTALL_DIR and NUGET_PACKAGES to D Drive on Windows
if: runner.os == 'Windows' && runner.environment == 'github-hosted' && !contains(runner.name, 'core_')
shell: pwsh
run: |
Set-GitHubEnv 'DOTNET_INSTALL_DIR' 'D:\dotnet'
Set-GitHubEnv 'NUGET_PACKAGES' 'D:\nuget'
# For wildcard .NET versions, the General Availability ("ga") channel should be selected. For concrete versions,
# this shouldn't be set, because that'll cause a warning.
- name: Set dotnet-quality
id: set-dotnet-quality
shell: pwsh
run: |
if ('${{ inputs.dotnet-version }}' -match 'x')
{
Set-GitHubOutput 'dotnet-quality' 'ga'
}
# setup-dotnet won't install a version if it is already preinstalled on the VM. Note that it checks the latest
# released .NET version for wildcard versions. So, e.g. with 6.0.x specified it'll still install 6.0.402 if the VM
# only has 6.0.401. See: https://github.com/actions/setup-dotnet/issues/356 about making this better.
- name: Set up .NET SDK
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
id: setup-dotnet
with:
dotnet-version: ${{ inputs.dotnet-version }}
dotnet-quality: ${{ steps.set-dotnet-quality.outputs.dotnet-quality }}
- name: Save .NET SDK Version Into Environment Variable
shell: pwsh
run: |
Set-GitHubEnv 'DOTNET_SDK_TO_USE' ${{ steps.setup-dotnet.outputs.dotnet-version }}