mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-22 19:41:08 +07:00
Merge branch 'master' into global-json
This commit is contained in:
commit
553ff3fdfc
@ -1,5 +1,9 @@
|
|||||||
# setup-dotnet
|
# setup-dotnet
|
||||||
|
|
||||||
|
<p align="left">
|
||||||
|
<a href="https://github.com/actions/setup-dotnet"><img alt="GitHub Actions status" src="https://github.com/actions/setup-dotnet/workflows/Main%20workflow/badge.svg"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
This action sets up a dotnet environment for use in actions by:
|
This action sets up a dotnet environment for use in actions by:
|
||||||
|
|
||||||
- optionally downloading and caching a version of dotnet by SDK version and adding to PATH
|
- optionally downloading and caching a version of dotnet by SDK version and adding to PATH
|
||||||
@ -15,7 +19,7 @@ steps:
|
|||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- uses: actions/setup-dotnet@v1
|
- uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
version: '2.2.103' // SDK Version to use.
|
dotnet-version: '2.2.103' // SDK Version to use.
|
||||||
- run: dotnet build <my project>
|
- run: dotnet build <my project>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -33,7 +37,7 @@ jobs:
|
|||||||
- name: Setup dotnet
|
- name: Setup dotnet
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.dotnet }}
|
dotnet-version: ${{ matrix.dotnet }}
|
||||||
- run: dotnet build <my project>
|
- run: dotnet build <my project>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
name: 'Setup Dotnet for use with actions'
|
name: 'Setup Dotnet environment'
|
||||||
description: 'Setup a Dotnet environment and add it to the PATH, additionally providing proxy support'
|
description: 'Setup a Dotnet environment and add it to the PATH, additionally providing proxy support'
|
||||||
author: 'GitHub'
|
author: 'GitHub'
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
dotnet-version:
|
||||||
description: 'SDK version to use. E.g. 2.2.104'
|
description: 'SDK version to use. E.g. 2.2.104'
|
||||||
|
# Deprecated option, do not use. Will not be supported after October 1, 2019
|
||||||
|
version:
|
||||||
|
description: 'Deprecated. Use dotnet-version instead. Will not be supported after October 1, 2019'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/setup-dotnet.js'
|
main: 'lib/setup-dotnet.js'
|
||||||
|
@ -27,6 +27,9 @@ function run() {
|
|||||||
// If not supplied then task is still used to setup proxy, auth, etc...
|
// If not supplied then task is still used to setup proxy, auth, etc...
|
||||||
//
|
//
|
||||||
let version = core.getInput('version');
|
let version = core.getInput('version');
|
||||||
|
if (!version) {
|
||||||
|
version = core.getInput('dotnet-version');
|
||||||
|
}
|
||||||
if (!version) {
|
if (!version) {
|
||||||
// Try to fall back to global.json
|
// Try to fall back to global.json
|
||||||
core.debug('No version found, trying to find version from global.json');
|
core.debug('No version found, trying to find version from global.json');
|
||||||
|
@ -10,6 +10,9 @@ export async function run() {
|
|||||||
// If not supplied then task is still used to setup proxy, auth, etc...
|
// If not supplied then task is still used to setup proxy, auth, etc...
|
||||||
//
|
//
|
||||||
let version: string = core.getInput('version');
|
let version: string = core.getInput('version');
|
||||||
|
if (!version) {
|
||||||
|
version = core.getInput('dotnet-version');
|
||||||
|
}
|
||||||
if (!version) {
|
if (!version) {
|
||||||
// Try to fall back to global.json
|
// Try to fall back to global.json
|
||||||
core.debug('No version found, trying to find version from global.json');
|
core.debug('No version found, trying to find version from global.json');
|
||||||
|
Loading…
Reference in New Issue
Block a user