From 45181b34d65f9d85b09a300654283dd11a49a9fd Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Carle <29762210+jscarle@users.noreply.github.com> Date: Tue, 16 Jan 2024 19:40:19 -0500 Subject: [PATCH] Added github workflows. --- .github/dependabot.yml | 11 ++++++++ .github/release.yml | 7 ++++++ .github/workflows/main.yml | 47 +++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 41 ++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/release.yml create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8c23067 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "nuget" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..6072919 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,7 @@ +# .github/release.yml + +changelog: + categories: + - title: Changes + labels: + - "*" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8f05ef0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,47 @@ +name: Release + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: 'csharp' + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Setup .NET 7.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Test + run: dotnet test --configuration Release --no-build --verbosity normal + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..4508ea7 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Setup .NET 7.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Setup .NET 8.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --configuration Release --no-restore + - name: Pack + run: dotnet pack --configuration Release --no-build --output . + - name: Push to NuGet + run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json