Merge branch 'master' into global-json

This commit is contained in:
Danny McCormick 2019-08-14 10:01:21 -04:00 committed by GitHub
commit 553ff3fdfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 4 deletions

View File

@ -1,5 +1,9 @@
# 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:
- 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/setup-dotnet@v1
with:
version: '2.2.103' // SDK Version to use.
dotnet-version: '2.2.103' // SDK Version to use.
- run: dotnet build <my project>
```
@ -33,7 +37,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
version: ${{ matrix.dotnet }}
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet build <my project>
```

View File

@ -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'
author: 'GitHub'
inputs:
version:
dotnet-version:
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:
using: 'node12'
main: 'lib/setup-dotnet.js'

View File

@ -27,6 +27,9 @@ function run() {
// If not supplied then task is still used to setup proxy, auth, etc...
//
let version = core.getInput('version');
if (!version) {
version = core.getInput('dotnet-version');
}
if (!version) {
// Try to fall back to global.json
core.debug('No version found, trying to find version from global.json');

View File

@ -10,6 +10,9 @@ export async function run() {
// If not supplied then task is still used to setup proxy, auth, etc...
//
let version: string = core.getInput('version');
if (!version) {
version = core.getInput('dotnet-version');
}
if (!version) {
// Try to fall back to global.json
core.debug('No version found, trying to find version from global.json');