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