You've already forked setup-dotnet
mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-07-13 10:30:32 +07:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
fe9489df58 | |||
10a142b9ea | |||
6e62e60a6f | |||
d6004ce18b | |||
99b3249572 |
13
README.md
13
README.md
@ -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>
|
||||
```
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user