Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/credfeto/action-dotnet-version-detect

detects the version of dotnet core that should be installed
https://github.com/credfeto/action-dotnet-version-detect

Last synced: about 1 month ago
JSON representation

detects the version of dotnet core that should be installed

Awesome Lists containing this project

README

        

# Dotnet core version detector

Determines the version of dotnet core to install based on the src/global.json

## How to use it?
This is a GitHub action, so it has to be added to a GitHub workflow.

A simple example of running this action on all pushes to the repository would be
to add a `dotnetcore.yml` file under `.github/workflows` with the following content
```yaml
on: [push]

jobs:
dotnet-build:
runs-on: ubuntu-latest
name:
steps:
# Checkout the source code so there are some files to look at.
- uses: actions/checkout@v1
# Run the version detection action
- name: Determine the version of dotnet core to install from src/global.json
uses: credfeto/[email protected]
with:
file: src/global.json
fallback: 3.1.404
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Build
run: |
cd src
dotnet build

```

On each push, it will now install the version of dotnet core specified in src/global.json, install it and build the source

## Contributors