Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
C# annotationscbzcomicinfocomicscomics-readercross-platformcsharpepubepub-readerfreelinuxmangamedia-servermetadataopdsopds-feedpdfself-hostedubooquitywindows
Adding Additional Workflows and Actions (#397)
Robbie Davisb5f92d46a949
diff --git a/.github/workflows/discord-release-msg.yml b/.github/workflows/discord-release-msg.ymldeleted file mode 100644index f3acd153e..000000000--- a/.github/workflows/discord-release-msg.yml+++ /dev/null@@ -1,17 +0,0 @@-name: Release messages to discord announcement channel--on:- release:- types:- - created--jobs:- run_main:- runs-on: ubuntu-18.04- name: Sends custom message- steps:- - name: Sending message- uses: nhevia/discord-styled-releases@main- with:- webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}- webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}\ No newline at end of filediff --git a/.github/workflows/monorepo-test.yml b/.github/workflows/monorepo-test.ymldeleted file mode 100644index 0408c0956..000000000--- a/.github/workflows/monorepo-test.yml+++ /dev/null@@ -1,38 +0,0 @@-name: Monorepo Build Test--on:- push:- branches:- - 'feature/monorepo'--jobs:- docker:- runs-on: ubuntu-latest- steps:-- - name: Check Out Repo- uses: actions/checkout@v2-- - name: NodeJS to Compile WebUI- uses: actions/[email protected]- with:- node-version: '14'- - run: |-- cd UI/Web || exit- echo 'Installing web dependencies'- npm install-- echo 'Building UI'- npm run prod-- echo 'Copying back to Kavita wwwroot'- rsync -a dist/ ../../API/wwwroot/-- cd ../ || exit-- - name: Compile dotnet app- uses: actions/setup-dotnet@v1- with:- dotnet-version: '5.0.x'- - run: ./monorepo-build.shdiff --git a/.github/workflows/nightly-docker.yml b/.github/workflows/nightly-docker.ymlindex 8f36afd82..c034492fe 100644--- a/.github/workflows/nightly-docker.yml+++ b/.github/workflows/nightly-docker.yml@@ -7,6 +7,7 @@ on:jobs:docker:+ name: Building Nightly Dockerruns-on: ubuntu-lateststeps:@@ -18,7 +19,6 @@ jobs:with:node-version: '14'- run: |-cd UI/Web || exitecho 'Installing web dependencies'npm install@@ -31,12 +31,34 @@ jobs:cd ../ || exit+ - name: Bump versions+ uses: SiqiLu/dotnet-bump-version@master+ with:+ version_files: "Kavita.Common/Kavita.Common.csproj"+ github_token: ${{ secrets.GITHUB_TOKEN }}++ - name: Get csproj Version+ uses: naminodarie/get-net-sdk-project-versions-action@v1+ id: get-version+ with:+ proj-path: Kavita.Common/Kavita.Common.csproj++ - name: Echo csproj version+ run: echo "${{steps.get-version.outputs.assembly-version}}"+- name: Compile dotnet appuses: actions/setup-dotnet@v1with:dotnet-version: '5.0.x'- run: ./monorepo-build.sh+ - name: Trigger Sentry workflow+ uses: benc-uk/workflow-dispatch@v1+ with:+ workflow: Sentry Map Release+ token: ${{ secrets.REPO_GHA_PAT }}+ inputs: '{ "version": "${{steps.get-version.outputs.assembly-version}}" }'+- name: Login to Docker Hubuses: docker/login-action@v1with:diff --git a/.github/workflows/sentry-map.yml b/.github/workflows/sentry-map.ymlnew file mode 100644index 000000000..3f53232bc--- /dev/null+++ b/.github/workflows/sentry-map.yml@@ -0,0 +1,63 @@+name: Sentry Map Release+on:+ workflow_dispatch:+ inputs:+ version:+ description: "version to update package.json"+ required: true+ # No default++jobs:+ build:+ name: Setup Sentry CLI+ runs-on: ubuntu-latest+ steps:+ - uses: mathieu-bour/[email protected]+ with:+ version: latest+ token: ${{ secrets.SENTRY_TOKEN }}+ organization: kavita-7n+ project: angular++ - name: Check out repository+ uses: actions/checkout@v2++ - name: Parse Version+ run: |+ version='${{ github.event.inputs.version }}'+ newVersion=${version%.*}+ echo $newVersion+ echo "::set-output name=VERSION::$newVersion"+ id: parse-version++ - name: NodeJS to Compile WebUI+ uses: actions/[email protected]+ with:+ node-version: '14'++ - run: |+ cd UI/Web || exit+ echo 'Installing web dependencies'+ npm install++ npm version --allow-same-version "${{ steps.parse-version.outputs.VERSION }}"++ echo 'Building UI'+ npm run prod++ - name: Cache dependencies+ uses: actions/cache@v2+ with:+ path: ~/.npm+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}+ restore-keys: |+ ${{ runner.os }}-node-++ - name: Create Release+ run: sentry-cli releases new ${{ steps.parse-version.outputs.VERSION }}++ - name: Upload Source Maps+ run: sentry-cli releases files ${{ steps.parse-version.outputs.VERSION }} upload-sourcemaps UI/Web/dist++ - name: Finalize Release+ run: sentry-cli releases finalize ${{ steps.parse-version.outputs.VERSION }}diff --git a/.github/workflows/sentry-release.yml b/.github/workflows/sentry-release.ymldeleted file mode 100644index 990dbc444..000000000--- a/.github/workflows/sentry-release.yml+++ /dev/null@@ -1,42 +0,0 @@-name: Sentry Release-on:- push:- branches: [ main, develop, feature/sentry-release ]--jobs:- build:- name: Setup Sentry CLI- runs-on: ubuntu-latest- steps:- - uses: mathieu-bour/[email protected]- with:- version: latest- token: ${{ SECRETS.SENTRY_TOKEN }}- organization: kavita-7n- project: angular- - name: Checkout- uses: actions/checkout@v2- - name: Install NodeJS- uses: actions/setup-node@v2- with:- node-version: '12'- - name: Cache dependencies- uses: actions/cache@v2- with:- path: ~/.npm- key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}- restore-keys: |- ${{ runner.os }}-node-- - name: Install Dependencies- run: npm install- - name: Build Angular- run: npm run prod- - name: get-npm-version- id: package-version- uses: martinbeentjes/npm-get-version-action@master- - name: Create Release- run: sentry-cli releases new ${{ steps.package-version.outputs.current-version }}- - name: Upload Source Maps- run: sentry-cli releases files ${{ steps.package-version.outputs.current-version }} upload-sourcemaps ./dist- - name: Finalize Release- run: sentry-cli releases finalize ${{ steps.package-version.outputs.current-version }}diff --git a/.github/workflows/build.yml b/.github/workflows/sonar-scan.ymlsimilarity index 89%rename from .github/workflows/build.ymlrename to .github/workflows/sonar-scan.ymlindex 231622b99..b6dfdf351 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/sonar-scan.yml@@ -1,4 +1,4 @@-name: .NET Core Build+name: .NET Build Test and Sonar Scanon:push:@@ -9,31 +9,34 @@ on:jobs:build:- name: Build+ name: Build and Scanruns-on: windows-lateststeps:- - uses: actions/checkout@v2+ - name: Checkout Repo+ uses: actions/checkout@v2with:fetch-depth: 0+- name: Setup .NET Coreuses: actions/setup-dotnet@v1with:dotnet-version: 5.0.100+- name: Install dependenciesrun: dotnet restore+- name: Set up JDK 11uses: actions/setup-java@v1with:java-version: 1.11- - uses: actions/checkout@v2- with:- fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis+- name: Cache SonarCloud packagesuses: actions/cache@v1with:path: ~\sonar\cachekey: ${{ runner.os }}-sonarrestore-keys: ${{ runner.os }}-sonar+- name: Cache SonarCloud scannerid: cache-sonar-scanneruses: actions/cache@v1@@ -41,12 +44,14 @@ jobs:path: .\.sonar\scannerkey: ${{ runner.os }}-sonar-scannerrestore-keys: ${{ runner.os }}-sonar-scanner+- name: Install SonarCloud scannerif: steps.cache-sonar-scanner.outputs.cache-hit != 'true'shell: powershellrun: |New-Item -Path .\.sonar\scanner -ItemType Directorydotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner+- name: Build and analyzeenv:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any@@ -56,5 +61,6 @@ jobs:.\.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: Testrun: dotnet test --no-restore --verbosity normaldiff --git a/.github/workflows/stable-docker.yml b/.github/workflows/stable-docker.ymlindex daeae851d..6dfed1b30 100644--- a/.github/workflows/stable-docker.yml+++ b/.github/workflows/stable-docker.yml@@ -31,12 +31,28 @@ jobs:cd ../ || exit+ - name: Get csproj Version+ uses: naminodarie/get-net-sdk-project-versions-action@v1+ id: get-version+ with:+ proj-path: Kavita.Common/Kavita.Common.csproj++ - name: Echo csproj version+ run: echo "${{steps.get-version.outputs.assembly-version}}"+- name: Compile dotnet appuses: actions/setup-dotnet@v1with:dotnet-version: '5.0.x'- run: ./monorepo-build.sh+ - name: Trigger Sentry workflow+ uses: benc-uk/workflow-dispatch@v1+ with:+ workflow: Sentry Map Release+ token: ${{ secrets.REPO_GHA_PAT }}+ inputs: '{ "version": "${{steps.get-version.outputs.assembly-version}}" }'+- name: Login to Docker Hubuses: docker/login-action@v1with:diff --git a/Dockerfile b/Dockerfileindex 4b1fb47b7..adead7274 100644--- a/Dockerfile+++ b/Dockerfile@@ -8,7 +8,7 @@ ARG TARGETPLATFORM#Move the output files to where they need to beRUN mkdir /filesCOPY _output/*.tar.gz /files/-COPY Kavita-webui/dist /files/wwwroot+COPY UI/Web/dist /files/wwwrootCOPY copy_runtime.sh /copy_runtime.shRUN /copy_runtime.sh