forked from Kareadita/Kavita
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
832 changed files
with
106,132 additions
and
41,856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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: | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 }} | ||
|
||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "[\"|`]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.