Compare commits

...

5 Commits

Author SHA1 Message Date
fe9489df58 Use dotnet-version (#16) 2019-08-13 16:05:52 -04:00
10a142b9ea Add badge 2019-08-12 15:11:11 -04:00
6e62e60a6f Update action name 2019-08-12 14:40:04 -04:00
d6004ce18b Sdk doc nits 2019-08-01 16:40:13 -04:00
99b3249572 Quoting 2019-08-01 11:05:47 -04:00
4 changed files with 22 additions and 8 deletions

View File

@ -1,8 +1,12 @@
# 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 version and adding to PATH
- optionally downloading and caching a version of dotnet by SDK version and adding to PATH
- registering problem matchers for error output
# Usage
@ -15,7 +19,7 @@ steps:
- uses: actions/checkout@master
- uses: actions/setup-dotnet@v1
with:
version: 2.2.103 // Version to use.
dotnet-version: '2.2.103' // SDK Version to use.
- run: dotnet build <my project>
```
@ -23,16 +27,17 @@ Matrix Testing:
```yaml
jobs:
build:
runs-on: ubuntu-16.04
strategy:
matrix:
dotnet: [ 2.2.103, 3.5.2, 4.5.1 ]
dotnet: [ '2.2.103', '3.5.2', '4.5.1' ]
name: Dotnet ${{ matrix.dotnet }} sample
steps:
- uses: actions/checkout@master
- 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:
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: 'Version to use. E.g. 2.2.104'
description: 'Deprecated. Use dotnet-version instead. Will not be supported after October 1, 2019'
runs:
using: 'node12'
main: 'lib/setup-dotnet.js'

View File

@ -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();

View File

@ -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();