From 3d501c953279447eea475e7289bb8c34b7f6f58f Mon Sep 17 00:00:00 2001 From: Joe Milazzo Date: Tue, 5 Sep 2023 05:43:05 -0700 Subject: [PATCH] [skip ci] Removed duplicate work from different release type jobs (#2273) --- .github/workflows/canary-workflow.yml | 61 ++------------------------ .github/workflows/develop-workflow.yml | 61 ++------------------------ .github/workflows/pr-check.yml | 7 --- .github/workflows/release-workflow.yml | 61 ++------------------------ 4 files changed, 12 insertions(+), 178 deletions(-) diff --git a/.github/workflows/canary-workflow.yml b/.github/workflows/canary-workflow.yml index a69cf2aa8..af353b915 100644 --- a/.github/workflows/canary-workflow.yml +++ b/.github/workflows/canary-workflow.yml @@ -4,76 +4,23 @@ on: push: branches: - canary - - '!release/**' + - '!release/**' jobs: build: - name: Build and Test - runs-on: windows-latest + name: Upload Kavita.Common for Version Bump + runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - - name: Install Swashbuckle CLI - shell: powershell - run: dotnet tool install -g --version 6.5.0 Swashbuckle.AspNetCore.Cli - - - name: Install dependencies - run: dotnet restore - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - uses: actions/upload-artifact@v3 with: name: csproj path: Kavita.Common/Kavita.Common.csproj - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~\sonar\cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Cache SonarCloud scanner - id: cache-sonar-scanner - uses: actions/cache@v3 - with: - path: .\.sonar\scanner - key: ${{ runner.os }}-sonar-scanner - restore-keys: ${{ runner.os }}-sonar-scanner - - - name: Install SonarCloud scanner - if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' - shell: powershell - run: | - New-Item -Path .\.sonar\scanner -ItemType Directory - dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner - - - name: Sonar Scan - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - shell: powershell - run: | - .\.sonar\scanner\dotnet-sonarscanner begin /k:"Kareadita_Kavita" /o:"kareadita" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" - dotnet build --configuration Release - .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" - - - name: Test - run: dotnet test --no-restore --verbosity normal - version: name: Bump version needs: [ build ] @@ -188,4 +135,4 @@ jobs: tags: jvmilazz0/kavita:canary, jvmilazz0/kavita:canary-${{ steps.parse-version.outputs.VERSION }}, ghcr.io/kareadita/kavita:canary, ghcr.io/kareadita/kavita:canary-${{ steps.parse-version.outputs.VERSION }} - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file + run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/develop-workflow.yml b/.github/workflows/develop-workflow.yml index b4edab114..b9a28f990 100644 --- a/.github/workflows/develop-workflow.yml +++ b/.github/workflows/develop-workflow.yml @@ -8,72 +8,19 @@ on: jobs: build: - name: Build and Test - runs-on: windows-latest + name: Upload Kavita.Common for Version Bump + runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 with: - fetch-depth: 0 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - - name: Install Swashbuckle CLI - shell: powershell - run: dotnet tool install -g --version 6.5.0 Swashbuckle.AspNetCore.Cli - - - name: Install dependencies - run: dotnet restore - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' + fetch-depth: 0 - uses: actions/upload-artifact@v3 with: name: csproj path: Kavita.Common/Kavita.Common.csproj - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~\sonar\cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Cache SonarCloud scanner - id: cache-sonar-scanner - uses: actions/cache@v3 - with: - path: .\.sonar\scanner - key: ${{ runner.os }}-sonar-scanner - restore-keys: ${{ runner.os }}-sonar-scanner - - - name: Install SonarCloud scanner - if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' - shell: powershell - run: | - New-Item -Path .\.sonar\scanner -ItemType Directory - dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner - - - name: Sonar Scan - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - shell: powershell - run: | - .\.sonar\scanner\dotnet-sonarscanner begin /k:"Kareadita_Kavita" /o:"kareadita" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" - dotnet build --configuration Release - .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" - - - name: Test - run: dotnet test --no-restore --verbosity normal - version: name: Bump version needs: [ build ] @@ -216,4 +163,4 @@ jobs: description: v${{steps.get-version.outputs.assembly-version}} - ${{ steps.findPr.outputs.title }} details: '${{ steps.findPr.outputs.body }}' text: <@&939225459156217917> <@&939225350775406643> A new nightly build has been released for docker. - webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }} \ No newline at end of file + webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }} diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 9a63e085e..7482deb0b 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -8,13 +8,6 @@ on: types: [synchronize] jobs: - test: - name: Test trigger - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/') && github.event.pull_request.base.ref == 'develop' - steps: - - name: Echo - run: echo 'Triggered' check_pr: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index 3b153b595..8fc9f1be5 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -6,72 +6,19 @@ on: jobs: build: - name: Build .Net - runs-on: windows-latest + name: Upload Kavita.Common for Version Bump + runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 with: - fetch-depth: 0 - - - name: Setup .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - - name: Install Swashbuckle CLI - shell: powershell - run: dotnet tool install -g --version 6.5.0 Swashbuckle.AspNetCore.Cli - - - name: Install dependencies - run: dotnet restore - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' + fetch-depth: 0 - uses: actions/upload-artifact@v3 with: name: csproj path: Kavita.Common/Kavita.Common.csproj - - name: Cache SonarCloud packages - uses: actions/cache@v3 - with: - path: ~\sonar\cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Cache SonarCloud scanner - id: cache-sonar-scanner - uses: actions/cache@v3 - with: - path: .\.sonar\scanner - key: ${{ runner.os }}-sonar-scanner - restore-keys: ${{ runner.os }}-sonar-scanner - - - name: Install SonarCloud scanner - if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' - shell: powershell - run: | - New-Item -Path .\.sonar\scanner -ItemType Directory - dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner - - - name: Sonar Scan - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - shell: powershell - run: | - .\.sonar\scanner\dotnet-sonarscanner begin /k:"Kareadita_Kavita" /o:"kareadita" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" - dotnet build --configuration Release - .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" - - - name: Test - run: dotnet test --no-restore --verbosity normal - stable: name: Build Stable and Nightly Docker if Release needs: [ build ] @@ -217,4 +164,4 @@ jobs: description: v${{steps.get-version.outputs.assembly-version}} - ${{ steps.findPr.outputs.title }} details: '${{ steps.findPr.outputs.body }}' text: <@&939225459156217917> <@&939225350775406643> A new nightly build has been released for docker. - webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }} \ No newline at end of file + webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}