Skip to content

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.

Feature/version bump test (#449)

Robbie Davise3cfbadd9d45
diff --git a/.github/workflows/nightly-docker.yml b/.github/workflows/nightly-docker.yml
index 9df2375cb..45621456a 100644
--- a/.github/workflows/nightly-docker.yml
+++ b/.github/workflows/nightly-docker.yml
@@ -1,9 +1,7 @@
name: Build Nightly Docker
on:
- push:
- branches:
- - 'develop'
+ workflow_dispatch:
jobs:
docker:
@@ -13,6 +11,8 @@ jobs:
- name: Check Out Repo
uses: actions/checkout@v2
+ with:
+ ref: develop
- name: NodeJS to Compile WebUI
uses: actions/[email protected]
diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml
index b6dfdf351..3955b7cb4 100644
--- a/.github/workflows/sonar-scan.yml
+++ b/.github/workflows/sonar-scan.yml
@@ -9,7 +9,35 @@ on:
jobs:
build:
- name: Build and Scan
+ name: Build .Net
+ runs-on: windows-latest
+ steps:
+ - name: Checkout Repo
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+
+ - name: Setup .NET Core
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 5.0.100
+
+ - name: Install dependencies
+ run: dotnet restore
+
+ - name: Set up JDK 11
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.11
+
+ - uses: actions/upload-artifact@v2
+ with:
+ name: csproj
+ path: Kavita.Common/Kavita.Common.csproj
+
+ test:
+ name: Install Sonar & Test
+ needs: build
runs-on: windows-latest
steps:
- name: Checkout Repo
@@ -52,7 +80,7 @@ jobs:
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- - name: Build and analyze
+ - name: Sonar Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -64,3 +92,121 @@ jobs:
- name: Test
run: dotnet test --no-restore --verbosity normal
+
+ bump:
+ name: Create branch for bump if Develop push
+ runs-on: ubuntu-latest
+ needs: [ build, test ]
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/download-artifact@v2
+
+ - 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: Get branch name
+ id: branch-name
+ uses: tj-actions/[email protected]
+
+ - name: Echo branch name
+ run: echo "${{ steps.branch-name.outputs.current_branch }}"
+
+ - name: Echo csproj version
+ run: echo "${{steps.get-version.outputs.assembly-version}}"
+
+ - name: Create Branch
+ uses: peterjgrainger/[email protected]
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ branch: "version-bump"
+
+ version:
+ name: Bump version if Develop push
+ needs: [ bump ]
+ runs-on: ubuntu-latest
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
+ steps:
+
+ - name: Download a single artifact
+ uses: actions/download-artifact@v2
+ with:
+ name: csproj
+
+ - name: Get csproj Version
+ uses: naminodarie/get-net-sdk-project-versions-action@v1
+ id: get-version
+ with:
+ proj-path: Kavita.Common.csproj
+
+ - name: Get branch name
+ id: branch-name
+ uses: tj-actions/[email protected]
+
+ - uses: actions/checkout@v2
+ with:
+ ref: version-bump
+ fetch-depth: 0
+
+ - name: Create local changes for reference
+ run: |
+ git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git config --local user.name "github-actions[bot]"
+ git pull origin version-bump-${{steps.get-version.outputs.assembly-version}}
+ git commit --allow-empty -m "Trigger Build"
+
+ - name: Push changes
+ uses: ad-m/github-push-action@master
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ branch: version-bump-${{steps.get-version.outputs.assembly-version}}
+
+ - name: Setup .NET Core
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 5.0.100
+
+ - name: Install dependencies
+ run: dotnet restore
+
+ - name: Build
+ run: dotnet build --configuration Release --no-restore
+
+ - name: Bump versions
+ uses: SiqiLu/dotnet-bump-version@master
+ with:
+ version_files: Kavita.Common/Kavita.Common.csproj
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Merge bump branch -> pr branch
+ uses: devmasx/[email protected]
+ with:
+ type: now
+ from_branch: version-bump-${{ github.event.inputs.version }}
+ target_branch: develop
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Trigger Docker Nightly
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
+ uses: benc-uk/workflow-dispatch@v1
+ with:
+ workflow: Build Nightly Docker
+ token: ${{ secrets.REPO_GHA_PAT }}
+
+ stable:
+ name: Trigger Stable Docker if Main push
+ needs: [ build, test ]
+ runs-on: ubuntu-latest
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
+ steps:
+
+ - name: If Push to Main, Trigger Docker Stable
+ if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
+ uses: benc-uk/workflow-dispatch@v1
+ with:
+ workflow: Build Stable Docker
+ token: ${{ secrets.REPO_GHA_PAT }}
\ No newline at end of file
diff --git a/.github/workflows/stable-docker.yml b/.github/workflows/stable-docker.yml
index cbf5c14c6..9f4dc8363 100644
--- a/.github/workflows/stable-docker.yml
+++ b/.github/workflows/stable-docker.yml
@@ -1,9 +1,7 @@
name: Build Stable Docker
on:
- push:
- branches:
- - 'main'
+ workflow_dispatch:
jobs:
docker:
@@ -12,6 +10,8 @@ jobs:
- name: Check Out Repo
uses: actions/checkout@v2
+ with:
+ ref: main
- name: NodeJS to Compile WebUI
uses: actions/[email protected]
@@ -99,7 +99,7 @@ jobs:
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
- description:
+ description: ${{ github.event.body }}
details: 'https://hub.docker.com/r/kizaing/kavita/tags?page=1&ordering=last_updated'
text: A new stable build has been released for docker.
webhookUrl: ${{ secrets.DISCORD_DOCKER_UPDATE_URL }}
\ No newline at end of file
diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml
deleted file mode 100644
index f7c02f11c..000000000
--- a/.github/workflows/version-bump.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-name: Bump .Net Version
-
-on:
- push:
- branches:
- - 'version-bump'
-
-jobs:
- bump:
- name: Version bump
- runs-on: windows-latest
- steps:
- - name: Checkout Repo
- uses: actions/checkout@v2
- with:
- fetch-depth: 0
- ref: version-bump
-
- - name: Setup .NET Core
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: 5.0.100
-
- - name: Install dependencies
- run: dotnet restore
-
- - name: Build
- run: dotnet build --configuration Release --no-restore
-
- - name: Bump versions
- uses: SiqiLu/dotnet-bump-version@master
- with:
- version_files: Kavita.Common/Kavita.Common.csproj
- github_token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Merge bump branch -> pr branch
- uses: devmasx/[email protected]
- with:
- type: now
- from_branch: version-bump
- target_branch: ${{ github.event.inputs.branch }}
- github_token: ${{ secrets.GITHUB_TOKEN }}