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