diff --git a/.github/workflows/TvdbClient-Nuget-Package.yml b/.github/workflows/TvdbClient-Nuget-Package.yml deleted file mode 100644 index 2ba11ae..0000000 --- a/.github/workflows/TvdbClient-Nuget-Package.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Publish Public Release on NuGet - -on: - push: - paths: [ 'src/**' ] - pull_request: - paths: [ 'src/**' ] - workflow_dispatch: - -env: - NET_VERSION: '9.x' - PROJECT_NAME: TvdbClient - PROJECT_FILE: TvdbClient.csproj - RELEASE_NAME: TvdbClient - RELEASE_CONFIG: Release - IS_PUBLIC_RELEASE: ${{ github.ref == 'refs/heads/main' }} # needs to be adjusted once we set up proper branching strategy - -jobs: - publish: - name: Publish on NuGet - runs-on: ubuntu-latest - - permissions: - contents: write # Add permissions to create a github release - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - - name: Setup .NET SDK ${{ env.NET_VERSION }} - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.NET_VERSION }} - dotnet-quality: 'ga' - - - name: Nerdbank.GitVersioning - uses: dotnet/nbgv@v0.4 - id: nbgv - with: - path: ${{ env.PROJECT_NAME }} - - - name: Install dependencies - run: dotnet restore - - - name: Build - run: dotnet build -c ${{ env.RELEASE_CONFIG }} --no-restore /p:PublicRelease=${{ env.IS_PUBLIC_RELEASE }} - - - name: Package - run: dotnet pack -c ${{ env.RELEASE_CONFIG }} -o . '${{ env.PROJECT_NAME }}/${{ env.PROJECT_FILE }}' /p:PublicRelease=${{ env.IS_PUBLIC_RELEASE }} - - - name: Publish on NuGet - run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json - - - name: Create release - uses: softprops/action-gh-release@v2 - with: - name: ${{ env.RELEASE_NAME }} ${{ steps.nbgv.outputs.NuGetPackageVersion }} - tag_name: v${{ steps.nbgv.outputs.NuGetPackageVersion }} - make_latest: ${{ env.IS_PUBLIC_RELEASE }} # If public release, then make latest - draft: false - prerelease: ${{ !env.IS_PUBLIC_RELEASE }} # If not public release, then prerelease \ No newline at end of file diff --git a/.github/workflows/TvdbClient-Unit-Tests.yml b/.github/workflows/TvdbClient-Unit-Tests.yml deleted file mode 100644 index 590d159..0000000 --- a/.github/workflows/TvdbClient-Unit-Tests.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Code Coverage - -on: - push: - paths: [ 'src/**','tests/**' ] - pull_request: - paths: [ 'src/**','tests/**' ] - workflow_dispatch: - -env: - NET_VERSION: '9.x' - RELEASE_CONFIG: Release - PROJECT_NAME: TvdbClient.Tests - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 # avoid shallow clone so nbgv can do its work. - - - name: Setup .NET SDK ${{ env.NET_VERSION }} - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.NET_VERSION }} - dotnet-quality: 'ga' - - - name: Install dependencies - run: dotnet restore - - - name: Build - run: dotnet build --no-restore - - - name: Run tests with coverage - run: dotnet test --configuration Release -- --report-trx --results-directory '**/${{env.PROJECT_NAME}}/TestResults' --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" --settings "coverlet.runsettings" --no-build - continue-on-error: true - - - name: Upload coverage report - uses: actions/upload-artifact@v4 - with: - name: coverage-report - path: '**/${{env.PROJECT_NAME}}/TestResults/**/coverage.cobertura.xml' - - - name: Code Coverage Report - uses: irongut/CodeCoverageSummary@v1.3.0 - with: - filename: '**/${{env.PROJECT_NAME}}/TestResults/**/coverage.cobertura.xml' - badge: true - fail_below_min: true - format: markdown - hide_branch_rate: false - hide_complexity: true - indicators: true - output: both - thresholds: '60 80' - - - name: Write to Job Summary - run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index d138685..59f4d1b 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.x' # Adjust to your .NET version + dotnet-version: '9.x' # Adjust to your .NET version - name: Restore dependencies run: dotnet restore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 79eb035..7605d42 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: '8.x' # Adjust to your .NET version + dotnet-version: '9.x' # Adjust to your .NET version - name: Install Nerdbank.GitVersioning run: dotnet tool install -g nbgv