From b1bda71e762617855bb1b1c9d479ff355ce508cb Mon Sep 17 00:00:00 2001 From: somni <82272900+somnisomni@users.noreply.github.com> Date: Sun, 17 Nov 2024 02:00:47 +0900 Subject: [PATCH] Create dotnet build action workflow --- .github/workflows/dotnet.yml | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..2e60b11 --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,38 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + workflow_dispatch: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + ROOT_CSPROJ_PATH: trawler-csharp.csproj + +jobs: + build-linux-x64: + name: \[Linux x64\] Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore --arch x64 + - name: Build using 'DebugCI' configuration + run: dotnet build $ROOT_CSPROJ_PATH --configuration DebugCI --arch x64 + - name: Test + run: dotnet test $ROOT_CSPROJ_PATH --no-build --verbosity normal --configuration DebugCI --arch x64 + - name: Publish the binary + run: dotnet publish $ROOT_CSPROJ_PATH --no-build --configuration DebugCI --arch x64 + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + name: Linux x64 + path: bin/DebugCI/publish/