Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
milindpatel63 committed Feb 23, 2024
2 parents 568286d + 9795080 commit d2c6d9a
Show file tree
Hide file tree
Showing 832 changed files with 106,132 additions and 41,856 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@ on:
push:
branches: '**'
pull_request:
branches: [ main, develop ]
branches: [ main, develop, canary ]
types: [synchronize]

jobs:
check_pr:
runs-on: ubuntu-latest
steps:
- name: Check PR Body
uses: JJ/github-pr-contains-action@releases/v10
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
bodyDoesNotContain: "[\"|`]"
build:
name: Build .Net
runs-on: windows-latest
Expand All @@ -37,26 +29,27 @@ jobs:
- name: Install dependencies
run: dotnet restore

- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.11
distribution: 'zulu'
java-version: '17'

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: csproj
path: Kavita.Common/Kavita.Common.csproj

- name: Cache SonarCloud packages
uses: actions/cache@v1
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@v1
uses: actions/cache@v3
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
Expand All @@ -83,10 +76,10 @@ jobs:
run: dotnet test --no-restore --verbosity normal

version:
name: Bump version on Develop push
name: Bump version on Develop/Canary push
needs: [ build ]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/canary') }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -97,15 +90,6 @@ jobs:
with:
dotnet-version: 7.0.x

- name: Install Swashbuckle CLI
run: dotnet tool install -g --version 6.5.0 Swashbuckle.AspNetCore.Cli

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Bump versions
uses: SiqiLu/[email protected]
with:
Expand All @@ -123,9 +107,10 @@ jobs:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
steps:
- name: Find Current Pull Request
uses: jwalton/gh-find-current-pr@v1.0.2
uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
state: all
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Parse PR body
Expand All @@ -146,21 +131,21 @@ jobs:
body=${body//$'`'/'%60'}
body=${body//$'>'/'%3E'}
echo $body
echo "::set-output name=BODY::$body"
echo "BODY=$body" >> $GITHUB_OUTPUT
- name: Check Out Repo
uses: actions/checkout@v3
with:
ref: develop

- name: NodeJS to Compile WebUI
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'
- run: |
cd UI/Web || exit
echo 'Installing web dependencies'
npm ci
npm install --legacy-peer-deps
echo 'Building UI'
npm run prod
Expand All @@ -171,15 +156,15 @@ jobs:
cd ../ || exit
- name: Get csproj Version
uses: naminodarie/get-net-sdk-project-versions-action@v1
uses: kzrnm/get-net-sdk-project-versions-action@v1
id: get-version
with:
proj-path: Kavita.Common/Kavita.Common.csproj

- name: Parse Version
run: |
version='${{steps.get-version.outputs.assembly-version}}'
echo "::set-output name=VERSION::$version"
echo "VERSION=$version" >> $GITHUB_OUTPUT
id: parse-version

- name: Echo csproj version
Expand Down Expand Up @@ -209,15 +194,15 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
Expand All @@ -232,7 +217,7 @@ jobs:
with:
severity: info
description: v${{steps.get-version.outputs.assembly-version}} - ${{ steps.findPr.outputs.title }}
details: '${{ steps.parse-body.outputs.BODY }}'
details: '${{ steps.findPr.outputs.body }}'
text: <@&939225459156217917> <@&939225350775406643> A new nightly build has been released for docker.
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}

Expand All @@ -243,13 +228,14 @@ jobs:
permissions:
packages: write
contents: read
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}
steps:

- name: Find Current Pull Request
uses: jwalton/gh-find-current-pr@v1.0.2
uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
state: all
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Parse PR body
Expand All @@ -270,22 +256,23 @@ jobs:
body=${body//$'`'/'%60'}
body=${body//$'>'/'%3E'}
echo $body
echo "::set-output name=BODY::$body"
echo "BODY=$body" >> $GITHUB_OUTPUT
- name: Check Out Repo
uses: actions/checkout@v3
with:
ref: main

- name: NodeJS to Compile WebUI
uses: actions/setup-node@v2.1.5
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16'
- run: |
cd UI/Web || exit
echo 'Installing web dependencies'
npm install
npm install --legacy-peer-deps
echo 'Building UI'
npm run prod
Expand All @@ -296,7 +283,7 @@ jobs:
cd ../ || exit
- name: Get csproj Version
uses: naminodarie/get-net-sdk-project-versions-action@v1
uses: kzrnm/get-net-sdk-project-versions-action@v1
id: get-version
with:
proj-path: Kavita.Common/Kavita.Common.csproj
Expand All @@ -309,7 +296,7 @@ jobs:
version='${{steps.get-version.outputs.assembly-version}}'
newVersion=${version%.*}
echo $newVersion
echo "::set-output name=VERSION::$newVersion"
echo "VERSION=$newVersion" >> $GITHUB_OUTPUT
id: parse-version

- name: Compile dotnet app
Expand All @@ -335,15 +322,15 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
Expand All @@ -358,6 +345,101 @@ jobs:
with:
severity: info
description: v${{steps.get-version.outputs.assembly-version}} - ${{ steps.findPr.outputs.title }}
details: '${{ steps.parse-body.outputs.BODY }}'
details: '${{ steps.findPr.outputs.body }}'
text: <@&939225192553644133> A new stable build has been released.
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}

canary:
name: Build Canary Docker if Canary push
needs: [ build, version ]
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/canary' }}
steps:
- name: Find Current Pull Request
uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
state: all
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Check Out Repo
uses: actions/checkout@v3
with:
ref: canary

- name: NodeJS to Compile WebUI
uses: actions/setup-node@v3
with:
node-version: '16'
- run: |
cd UI/Web || exit
echo 'Installing web dependencies'
npm install --legacy-peer-deps
echo 'Building UI'
npm run prod
echo 'Copying back to Kavita wwwroot'
rsync -a dist/ ../../API/wwwroot/
cd ../ || exit
- name: Get csproj Version
uses: kzrnm/get-net-sdk-project-versions-action@v1
id: get-version
with:
proj-path: Kavita.Common/Kavita.Common.csproj

- name: Parse Version
run: |
version='${{steps.get-version.outputs.assembly-version}}'
echo "VERSION=$version" >> $GITHUB_OUTPUT
id: parse-version

- name: Echo csproj version
run: echo "${{steps.get-version.outputs.assembly-version}}"

- name: Compile dotnet app
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x

- name: Install Swashbuckle CLI
run: dotnet tool install -g --version 6.5.0 Swashbuckle.AspNetCore.Cli

- run: ./monorepo-build.sh

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: kizaing/kavita:canary, kizaing/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 }}
18 changes: 18 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Validate PR Body

on:
push:
branches: '**'
pull_request:
branches: [ main, develop, canary ]
types: [synchronize]

jobs:
check_pr:
runs-on: ubuntu-latest
steps:
- name: Check PR Body
uses: JJ/github-pr-contains-action@releases/v10
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
bodyDoesNotContain: "[\"|`]"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ UI/Web/dist/
/API/config/themes/
/API/config/stats/
/API/config/bookmarks/
/API/config/favicons/
/API/config/kavita.db
/API/config/kavita.db-shm
/API/config/kavita.db-wal
Expand Down
4 changes: 2 additions & 2 deletions API.Benchmark/API.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="BenchmarkDotNet.Annotations" Version="0.13.5" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.7" />
<PackageReference Include="BenchmarkDotNet.Annotations" Version="0.13.7" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
</ItemGroup>

Expand Down
Loading

0 comments on commit d2c6d9a

Please sign in to comment.