Use dotnet-version (#16)

This commit is contained in:
Danny McCormick 2019-08-13 16:05:52 -04:00 committed by GitHub
parent 10a142b9ea
commit fe9489df58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 5 deletions

View File

@ -19,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>
``` ```
@ -37,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>
``` ```

View File

@ -2,8 +2,11 @@ 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'

View File

@ -25,7 +25,10 @@ function run() {
// Version is optional. If supplied, install / use from the tool cache // Version is optional. If supplied, install / use from the tool cache
// 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...
// //
const version = core.getInput('version'); let version = core.getInput('version');
if (!version) {
version = core.getInput('dotnet-version');
}
if (version) { if (version) {
const dotnetInstaller = new installer.DotnetCoreInstaller(version); const dotnetInstaller = new installer.DotnetCoreInstaller(version);
yield dotnetInstaller.installDotnet(); yield dotnetInstaller.installDotnet();

View File

@ -8,7 +8,10 @@ async function run() {
// Version is optional. If supplied, install / use from the tool cache // Version is optional. If supplied, install / use from the tool cache
// 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...
// //
const version = core.getInput('version'); let version = core.getInput('version');
if (!version) {
version = core.getInput('dotnet-version');
}
if (version) { if (version) {
const dotnetInstaller = new installer.DotnetCoreInstaller(version); const dotnetInstaller = new installer.DotnetCoreInstaller(version);
await dotnetInstaller.installDotnet(); await dotnetInstaller.installDotnet();