Skip to content

Commit

Permalink
Merge branch 'master' into global-json
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny McCormick authored and GitHub committed Aug 14, 2019
2 parents 8b1e9dd + fe9489d commit 553ff3f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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>
```
Expand All @@ -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>
```
Expand Down
7 changes: 5 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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'
3 changes: 3 additions & 0 deletions lib/setup-dotnet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 3 additions & 0 deletions src/setup-dotnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 553ff3f

Please sign in to comment.