Skip to content

Instantly share code, notes, and snippets.

@mttaggart
Created April 27, 2022 18:50
Show Gist options
  • Select an option

  • Save mttaggart/b8b6b2eb45b3846bb0a18a0deaa9f21b to your computer and use it in GitHub Desktop.

Select an option

Save mttaggart/b8b6b2eb45b3846bb0a18a0deaa9f21b to your computer and use it in GitHub Desktop.

Revisions

  1. mttaggart created this gist Apr 27, 2022.
    33 changes: 33 additions & 0 deletions dotnet.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    # This is a template GitHub Action YAML file for building .NET projects.
    # Handy for forking .NET assembly projects and building easily without VS.
    # Make sure to replace "MyAssembly" with the name of the project!
    name: .NET

    on:
    push:
    branches: [ main ]
    pull_request:
    branches: [ main ]

    jobs:
    build:

    runs-on: windows-latest

    steps:
    - uses: actions/checkout@v3
    - name: Setup .NET
    uses: actions/setup-dotnet@v2
    with:
    dotnet-version: 6.0.*
    - name: Restore dependencies
    run: dotnet restore
    - name: Build
    run: dotnet build --no-restore --configuration Release
    - name: Test
    run: dotnet test --no-build --verbosity normal
    - name: Upload Artifact
    uses: actions/upload-artifact@v2
    with:
    name: MyAssembly.exe
    path: D:\a\MyAssembly\MyAssembly\MyAssembly\bin\Release\MyAssembly.exe