From 912469de12545814807528b83d7221cade79074a Mon Sep 17 00:00:00 2001 From: Robbie Davis Date: Mon, 2 Aug 2021 09:54:57 -0400 Subject: [PATCH] Feature/version bump (#456) ** Changes - Workflow changes --- .github/workflows/sonar-scan.yml | 72 ++++++------------------------ Kavita.Common/Kavita.Common.csproj | 2 +- 2 files changed, 15 insertions(+), 59 deletions(-) diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml index fddfa4cc5..fef98472e 100644 --- a/.github/workflows/sonar-scan.yml +++ b/.github/workflows/sonar-scan.yml @@ -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 }} \ No newline at end of file + token: ${{ secrets.REPO_GHA_PAT }} diff --git a/Kavita.Common/Kavita.Common.csproj b/Kavita.Common/Kavita.Common.csproj index fbba64189..530819ef9 100644 --- a/Kavita.Common/Kavita.Common.csproj +++ b/Kavita.Common/Kavita.Common.csproj @@ -19,4 +19,4 @@ - + \ No newline at end of file