From c475fc8df7aa6d0db27b222120ea5fa75abc4300 Mon Sep 17 00:00:00 2001 From: Elanis Date: Thu, 27 Feb 2025 20:00:22 +0100 Subject: [PATCH] CI + Dependabot config --- .github/dependabot.yml | 15 ++++ .github/workflows/dotnet.yml | 74 +++++++++++++++++++ .../Lumen.Modules.Youtube.Module.csproj | 3 + 3 files changed, 92 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/dotnet.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..48c8eeb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# 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: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + - package-ecosystem: "nuget" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "monthly" \ No newline at end of file diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 0000000..24605be --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,74 @@ +name: .NET + +on: + push: + pull_request: + workflow_dispatch: + +env: + SONAR_KEY: lumen-module-youtube + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + MODULE_NAME: Lumen.Modules.Youtube + RELEASE_FILES_LOCATION: Lumen.Modules.Youtube.Module/bin/Release/net9.0/*.dll + CSPROJ: Lumen.Modules.Youtube.Module/Lumen.Modules.Youtube.Module.csproj + NUGET_SERVER_ADRESS: https://api.nuget.org/v3/index.json + NUGET_SERVER_KEY: ${{ secrets.NUGET_ORG_KEY }} + RUN_TESTS: 'false' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.0.x + + - uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + + - name: Setup sonarscanner + run: | + dotnet tool install --global dotnet-sonarscanner + + - name: Start sonarscanner + run: dotnet sonarscanner begin /k:"${{ env.SONAR_KEY }}" /d:sonar.host.url="${{ env.SONAR_HOST_URL }}" /d:sonar.token="${{ env.SONAR_TOKEN }}" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.coverage.exclusions="**Test*.cs" /d:sonar.branch.name="${{github.ref_name}}" + + - name: Set Version in csproj + if: startsWith(github.event.ref, 'refs/tags/') + run: sed -i 's/>1.0.0${{github.ref_name}}net9.0 enable enable + 1.0.0 + 1.0.0 + 1.0.0