mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
parent
74dc6fd5dc
commit
912469de12
70
.github/workflows/sonar-scan.yml
vendored
70
.github/workflows/sonar-scan.yml
vendored
@ -2,7 +2,7 @@ name: .NET Build Test and Sonar Scan
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, develop ]
|
branches: '**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main, develop ]
|
branches: [ main, develop ]
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
@ -93,63 +93,14 @@ jobs:
|
|||||||
- name: Test
|
- name: Test
|
||||||
run: dotnet test --no-restore --verbosity normal
|
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/branch-names@v4.5
|
|
||||||
|
|
||||||
- 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/action-create-branch@v2.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
branch: "version-bump-${{steps.get-version.outputs.assembly-version}}"
|
|
||||||
|
|
||||||
version:
|
version:
|
||||||
name: Bump version if Develop push
|
name: Bump version on Develop push
|
||||||
needs: [ bump ]
|
needs: [ build, test ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
|
||||||
steps:
|
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/branch-names@v4.5
|
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: version-bump-${{steps.get-version.outputs.assembly-version}}
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup .NET Core
|
- name: Setup .NET Core
|
||||||
@ -167,10 +118,16 @@ jobs:
|
|||||||
uses: SiqiLu/dotnet-bump-version@master
|
uses: SiqiLu/dotnet-bump-version@master
|
||||||
with:
|
with:
|
||||||
version_files: Kavita.Common/Kavita.Common.csproj
|
version_files: Kavita.Common/Kavita.Common.csproj
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.REPO_GHA_PAT }}
|
||||||
|
|
||||||
- name: Trigger Docker Nightly
|
develop:
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
|
name: Trigger Nightly Docker if Develop push
|
||||||
|
needs: [ build, test, version ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: If Push to Develop, Trigger Docker Stable
|
||||||
uses: benc-uk/workflow-dispatch@v1
|
uses: benc-uk/workflow-dispatch@v1
|
||||||
with:
|
with:
|
||||||
workflow: Build Nightly Docker
|
workflow: Build Nightly Docker
|
||||||
@ -180,11 +137,10 @@ jobs:
|
|||||||
name: Trigger Stable Docker if Main push
|
name: Trigger Stable Docker if Main push
|
||||||
needs: [ build, test ]
|
needs: [ build, test ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: If Push to Main, Trigger Docker Stable
|
- name: If Push to Main, Trigger Docker Stable
|
||||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
||||||
uses: benc-uk/workflow-dispatch@v1
|
uses: benc-uk/workflow-dispatch@v1
|
||||||
with:
|
with:
|
||||||
workflow: Build Stable Docker
|
workflow: Build Stable Docker
|
||||||
|
Loading…
x
Reference in New Issue
Block a user