Skip to content

Commit

Permalink
Use dotnet-version (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny McCormick authored Aug 13, 2019
1 parent 10a142b commit fe9489d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,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>
```
Expand All @@ -37,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>
```
Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ 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'
5 changes: 4 additions & 1 deletion lib/setup-dotnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ function run() {
// Version is optional. If supplied, install / use from the tool cache
// 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) {
const dotnetInstaller = new installer.DotnetCoreInstaller(version);
yield dotnetInstaller.installDotnet();
Expand Down
5 changes: 4 additions & 1 deletion src/setup-dotnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ async function run() {
// Version is optional. If supplied, install / use from the tool cache
// 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) {
const dotnetInstaller = new installer.DotnetCoreInstaller(version);
await dotnetInstaller.installDotnet();
Expand Down

0 comments on commit fe9489d

Please sign in to comment.