From 825426c536d57b0c48ad2226dee5fb3fda2d2b3d Mon Sep 17 00:00:00 2001 From: David Collom Date: Tue, 27 Aug 2024 19:33:23 +0100 Subject: [PATCH] Create a better/more indepth changelog --- .github/workflows/helm-docs.yaml | 4 +++- .github/workflows/release.yaml | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm-docs.yaml b/.github/workflows/helm-docs.yaml index dad0635..e903b13 100644 --- a/.github/workflows/helm-docs.yaml +++ b/.github/workflows/helm-docs.yaml @@ -1,5 +1,7 @@ name: Generate Helm Docs on: + # Allow other workflows to trigger + workflow_call: push: paths: - '!*.md' @@ -64,4 +66,4 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.head_ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} \ No newline at end of file + repository: ${{ github.event.pull_request.head.repo.full_name }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7362629..1f0284f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,7 +5,7 @@ on: branches: - "release-v*" tags: - - "*" + - "v*" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -27,6 +27,7 @@ jobs: with: value: ${{github.ref_name}} index_of_str: "release-" + - name: Find and Replace Helm Chart Version uses: jacobtomlinson/gha-find-replace@v3 with: @@ -34,6 +35,7 @@ jobs: replace: "${{steps.release_number.outputs.substring}}" include: "deploy/charts/version-checker/Chart.yaml" regex: true + - name: Find and Replace Kubernetes Manifests uses: jacobtomlinson/gha-find-replace@v3 with: @@ -41,6 +43,7 @@ jobs: replace: "${{steps.release_number.outputs.substring}}" include: "deploy/yaml/deploy.yaml" regex: true + - name: Find and Replace Makefile versions uses: jacobtomlinson/gha-find-replace@v3 with: @@ -48,6 +51,18 @@ jobs: replace: "${{steps.release_number.outputs.substring}}" include: "Makefile" regex: true + + + - name: Install Helm Docs + uses: envoy/install-helm-docs@v1.0.0 + with: + version: 1.11.0 + - name: Update Helm Docs + run: | + set -ex + cd deploy/charts/version-checker + helm-docs + - name: Detect any Local Changes uses: dorny/paths-filter@v3 id: filter @@ -58,6 +73,8 @@ jobs: - 'Makefile' - 'deploy/yaml/deploy.yaml' - 'deploy/charts/version-checker/Chart.yaml' + - 'deploy/charts/version-checker/README.md' + - name: Commit files if: steps.filter.outputs.versions == 'true' run: | @@ -65,19 +82,30 @@ jobs: git config --local user.name "github-actions[bot]" git status git commit -a -m "Bump versions to ${{steps.release_number.outputs.substring}} " + - name: Push changes if: steps.filter.outputs.versions == 'true' uses: ad-m/github-push-action@v0.8.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref_name }} + + - name: Build Changelog + id: github_release + uses: mikepenz/release-changelog-builder-action@v5 + + - name: Create Release PR uses: devops-infra/action-pull-request@v0.5.5 with: github_token: ${{ secrets.GITHUB_TOKEN }} target_branch: main title: "Release ${{steps.release_number.outputs.substring}}" - body: "**Automated Release Pull Request**" + body: |- + "**Automated Release Pull Request** + + ## Change log: + ${{steps.github_release.outputs.changelog}} draft: false get_diff: false allow_no_diff: false