Generating outdated, licenses and thanks with .NET Core tools

Last time (http://msprogrammer.serviciipeweb.ro/2020/06/08/net-core-local-tools/) I have discussed about local tools . Now it is time to show something in practice, beside code coverage ( detailed http://msprogrammer.serviciipeweb.ro/2019/12/09/code-coveragepart-25/ and video https://youtu.be/JvahoA0WWms  ) ,

Let’ make something simple: generate outdated packages list, licenses and thanks.

I will use this packages

“dotnet-project-licenses”: {

“version”: “2.1.0”,

“commands”: [

“dotnet-project-licenses”

]

},

“dotnetthx”: {

“version”: “0.2.0”,

“commands”: [

“dotnet-thx”

]

},

“dotnet-depends”: {

“version”: “0.4.0”,

“commands”: [

“dotnet-depends”

]

},

“dotnet-outdated”: {

“version”: “2.11.0”,

“commands”: [

“dotnet-outdated”

]

}

And I will make a github action to run  to generate the outdated, licenses and thanks

name: .NET Core

on:

push:

branches: [ master ]

jobs:

build:

runs-on: windows-latest

steps:

– uses: actions/checkout@v2

– name: Setup .NET Core

uses: actions/setup-dotnet@v1

with:

dotnet-version: 3.1.101

– name: Install dependencies

run: |

        cd src

        cd NetCore2Blockly

        dotnet restore

        echo ‘done restore’

        dotnet tool restore –add-source https://myget.org/F/natemcmaster/api/v3/index.json

        dotnet dotnet-project-licenses  -j  -i .

        echo ‘done project licences’

        dotnet dotnet-thx > thanks.txt

        echo ‘done thanks’

        dotnet dotnet-outdated -o outdated.csv -of csv

        echo ‘done outdated’

        dotnet pwsh copyToRoot.ps1

        cd ..

        cd ..

        echo ‘back to source dir’

– name: test

run: echo done

– name: run commit

run: |

        git config –local user.email “action@github.com”

        git config –local user.name “GitHub Action”

        git add –all

        git status

        git commit -m “generate thanks, outdate, licences” -a –allow-empty

shell: cmd

– name: Push changes

uses: ad-m/github-push-action@master

with:

github_token: ${{ secrets.GITHUB_TOKEN }}

The powershell file that copies everything is here:

Move-Item .\licenses.json ..\..\licencesNetCore.json

Write-Host ‘copied licenses.json ‘

Move-Item .\outdated.csv ..\..\outdatedNetCore.csv

Write-Host ‘copied outdated.csv ‘

Move-Item .\thanks.txt ..\..\thanksNetCore.txt

Write-Host ‘copied thanks.txt ‘

And  you can see the result at

https://github.com/ignatandrei/NETCoreBlockly/blob/master/thanksNetCore.txt

https://github.com/ignatandrei/NETCoreBlockly/blob/master/outdatedNetCore.csv

https://github.com/ignatandrei/NETCoreBlockly/blob/master/licencesNetCore.json

You can find also a list of tools here: https://github.com/natemcmaster/dotnet-tools