Create a .NET App With GitHub Actions

This blog post will show you how to create a .NET console application in C# with GitHub Actions.

GitHub Actions allow us to run .NET code applications on Linunx or Windows runners since both of them are capable of running .NET 5.


In the below workflow, I am creating a simple console application using C#.

The application will use the latest .NET 5 version that is available on GitHub Actions runner. I can also create an artifact from the code, as we learn in the previous post on the topic.

name: Create a .NET app

    branches: [ main ]
    branches: [ main ]


    runs-on: ubuntu-latest

    - uses: actions/[email protected]
    - name: Setup .NET
      uses: actions/[email protected]
        dotnet-version: 5.0.x
    - name: Create a new console app
      run: dotnet new console -o myApp
    - name: Run app
      run: | 
       cd myApp
       dotnet run

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.