From 36b36f33c9d509dd4f43c573974602fa9bf0db6e Mon Sep 17 00:00:00 2001 From: Chris Pietschmann Date: Thu, 6 Feb 2025 14:47:46 -0500 Subject: [PATCH] add github actions workflows --- .github/workflows/build-release.yml | 41 +++++++++++++++++++++++++++++ .github/workflows/dotnet-tests.yml | 32 ++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/build-release.yml create mode 100644 .github/workflows/dotnet-tests.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 0000000..4571ee6 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,41 @@ +name: Build and Release + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: src + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '6.0.x' # Adjust the version as needed + + - name: Restore dependencies + run: dotnet restore src + + - name: Run tests + run: dotnet test --no-build --verbosity normal + + - name: Build + run: dotnet build --configuration Release --no-restore + + - name: Publish + run: dotnet publish --configuration Release --output ./publish --no-build + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: release-build + path: ./publish \ No newline at end of file diff --git a/.github/workflows/dotnet-tests.yml b/.github/workflows/dotnet-tests.yml new file mode 100644 index 0000000..02ade40 --- /dev/null +++ b/.github/workflows/dotnet-tests.yml @@ -0,0 +1,32 @@ +name: .NET Core + +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: src + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup .NET Core + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '6.0.x' # Adjust the version as needed + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build --no-restore + + - name: Run tests + run: dotnet test --no-build --verbosity normal \ No newline at end of file