From b47b6e2d11185623eaf9b10f5662f6a58e6720c0 Mon Sep 17 00:00:00 2001 From: Fredi Kats Date: Sun, 12 May 2024 00:40:02 +0200 Subject: [PATCH] Migrate from custom CI to dotnet-releaser --- .github/workflows/build-test.yaml | 52 ---------------------------- .github/workflows/ci-cd.yaml | 13 +++++++ .github/workflows/nuget-publish.yaml | 47 ------------------------- Sources/Directory.Build.props | 4 +-- Sources/dotnet-releaser.toml | 6 ++++ 5 files changed, 21 insertions(+), 101 deletions(-) delete mode 100644 .github/workflows/build-test.yaml create mode 100644 .github/workflows/ci-cd.yaml delete mode 100644 .github/workflows/nuget-publish.yaml create mode 100644 Sources/dotnet-releaser.toml diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml deleted file mode 100644 index d95bdb5..0000000 --- a/.github/workflows/build-test.yaml +++ /dev/null @@ -1,52 +0,0 @@ -name: Build and test - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ '*' ] - - -env: - working-directory: Sources - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - DOTNET_NOLOGO: true - dotnet-version: 8.0.x - -jobs: - build: - runs-on: windows-latest - - steps: - - run: git config --global core.autocrlf true - - uses: actions/checkout@v3 - - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.dotnet-version }} - - - name: Restore dependencies - run: dotnet restore - working-directory: ${{ env.working-directory }} - - - name: Build - run: dotnet build -c Release --no-restore --verbosity normal - working-directory: ${{ env.working-directory }} - - - name: Test - run: dotnet test -c Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - working-directory: ${{ env.working-directory }} - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - - name: Run mutation tests - run: | - dotnet tool restore - dotnet stryker --reporter dashboard - working-directory: ${{ env.working-directory }} - env: - STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml new file mode 100644 index 0000000..7203fa1 --- /dev/null +++ b/.github/workflows/ci-cd.yaml @@ -0,0 +1,13 @@ +name: CI/CD + +on: + push: + pull_request: + +jobs: + build: + uses: Kysect/.github/.github/workflows/dotnet-releaser.yaml@master + with: + dotnet-version: '8.0' + secrets: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} \ No newline at end of file diff --git a/.github/workflows/nuget-publish.yaml b/.github/workflows/nuget-publish.yaml deleted file mode 100644 index 580cd4a..0000000 --- a/.github/workflows/nuget-publish.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: Publish nuget - -on: - push: - branches: [ "master" ] - -env: - working-directory: Sources - release-directory: ./artifacts/package/release - dotnet-version: 8.0.x - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - run: git config --global core.autocrlf input - - uses: actions/checkout@v3 - - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: ${{ env.dotnet-version }} - - - name: Restore dependencies - run: dotnet restore - working-directory: ${{ env.working-directory }} - - - name: Build - run: dotnet build -c Release /p:ContinuousIntegrationBuild=true --no-restore --verbosity normal - working-directory: ${{ env.working-directory }} - - - name: Test - run: dotnet test -c Release --no-build --verbosity normal - working-directory: ${{ env.working-directory }} - - - name: Pack - run: dotnet pack --no-build - working-directory: ${{ env.working-directory }} - - - name: Publish to Nuget - run: dotnet nuget push ${{ env.release-directory }}/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate - working-directory: ${{ env.working-directory }} - - - name: Publish to Nuget symbols - run: dotnet nuget push ${{ env.release-directory }}/*.snupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate - working-directory: ${{ env.working-directory }} \ No newline at end of file diff --git a/Sources/Directory.Build.props b/Sources/Directory.Build.props index 5b74730..32b5026 100644 --- a/Sources/Directory.Build.props +++ b/Sources/Directory.Build.props @@ -35,7 +35,7 @@ - - + + \ No newline at end of file diff --git a/Sources/dotnet-releaser.toml b/Sources/dotnet-releaser.toml new file mode 100644 index 0000000..bee692b --- /dev/null +++ b/Sources/dotnet-releaser.toml @@ -0,0 +1,6 @@ +# configuration file for dotnet-releaser +[msbuild] +project = "Kysect.DotnetProjectSystem.sln" +[github] +user = "kysect" +repo = "DotnetProjectSystem"