From 42ac5ef251e8e4c8bcc2487a3f10649c80d130a9 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Tue, 19 Nov 2024 18:51:07 +0100 Subject: [PATCH 01/13] fix: add clean parameter to checkout action --- actions/checkout/action.yaml | 5 +++++ docs/actions/checkout/README.md | 1 + 2 files changed, 6 insertions(+) diff --git a/actions/checkout/action.yaml b/actions/checkout/action.yaml index 8b6dc1276..bf4843a65 100644 --- a/actions/checkout/action.yaml +++ b/actions/checkout/action.yaml @@ -25,6 +25,10 @@ inputs: description: "Describes if the repository is using any LFS files" required: false default: "true" + clean: + description: "Clean the repository before running the action." + required: false + default: "true" submodules: description: "Whether to checkout submodules: `true` to checkout submodules or `recursive` to recursively checkout submodules." required: false @@ -46,6 +50,7 @@ runs: persist-credentials: ${{ inputs.persist-credentials }} submodules: ${{ inputs.submodules }} fetch-depth: ${{ inputs.fetch-depth }} + clean: ${{ inputs.clean }} - name: Create LFS file list if: ${{ inputs.lfs == 'true'}} diff --git a/docs/actions/checkout/README.md b/docs/actions/checkout/README.md index cf5ac1095..341d70653 100644 --- a/docs/actions/checkout/README.md +++ b/docs/actions/checkout/README.md @@ -35,6 +35,7 @@ steps: | INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION | | ------------------- | ------ | -------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------- | | cache | string | false | `"true"` | Describes if the repository is using any LFS files | +| clean | string | false | `"true"` | Clean the repository before running the action. | | fetch-depth | string | false | `"1"` | Number of commits to fetch. 0 indicates all history for all branches and tags | | lfs | string | false | `"false"` | Describes if the repository is using any LFS files | | persist-credentials | string | false | `"true"` | Whether to configure the token or SSH key with the local git config | From e921257378313ee1d79976da35dc3b5cc7368261 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Tue, 19 Nov 2024 18:51:39 +0100 Subject: [PATCH 02/13] fix: add clean and checkout option to changelog action --- actions/changelog-generate/action.yaml | 12 +++++++++++- docs/actions/changelog-generate/README.md | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index 923c969f7..9214bb7c1 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -13,6 +13,14 @@ inputs: description: Path to the changelog file in the GitHub repository required: false default: "CHANGELOG.md" + checkout: + description: "Whether to checkout the repository or not." + required: false + default: "false" + clean: + description: "Clean the repository before running the action." + required: false + default: false outputs: merged-changelog: @@ -26,9 +34,11 @@ runs: using: "composite" steps: - name: Check out repository - uses: bakdata/ci-templates/actions/checkout@1.49.0 + uses: bakdata/ci-templates/actions/checkout@tiedemann/changelog-action-fix + if: ${{ inputs.checkout}} with: fetch-depth: 0 + clean: ${{ inputs.clean }} - name: Get config path id: get-config-path run: | diff --git a/docs/actions/changelog-generate/README.md b/docs/actions/changelog-generate/README.md index 8f9e7ac9f..700f3c5dc 100644 --- a/docs/actions/changelog-generate/README.md +++ b/docs/actions/changelog-generate/README.md @@ -89,6 +89,8 @@ steps: | INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION | | -------------- | ------ | -------- | ---------------- | --------------------------------------------------- | | changelog-file | string | false | `"CHANGELOG.md"` | Path to the changelog file in the GitHub repository | +| checkout | string | false | `"false"` | Whether to checkout the repository or not. | +| clean | string | false | `"false"` | Clean the repository before running the action. | | github-token | string | true | | The GitHub token for committing the changes. | | tag | string | true | | Version after bump | From 79d841977b7fbfd4e241931c87f7889d420f3c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 10:56:04 +0100 Subject: [PATCH 03/13] Fix if conditions --- .github/workflows/bump-version-release.yaml | 2 +- .github/workflows/helm-release.yaml | 6 +++--- .github/workflows/python-poetry-release.yaml | 2 +- .github/workflows/release-tag-versions.yaml | 2 +- actions/changelog-generate/action.yaml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bump-version-release.yaml b/.github/workflows/bump-version-release.yaml index ef924811f..fc514cf48 100644 --- a/.github/workflows/bump-version-release.yaml +++ b/.github/workflows/bump-version-release.yaml @@ -69,7 +69,7 @@ jobs: - name: Create changelog id: build-changelog uses: bakdata/ci-templates/actions/changelog-generate@1.49.0 - if: ${{ inputs.changelog }} + if: ${{ inputs.changelog == 'true' }} with: github-token: ${{ secrets.github-token }} tag: ${{ steps.bump-version.outputs.release-version }} diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml index 13a4922e2..58d352cb3 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release.yaml @@ -100,14 +100,14 @@ jobs: - name: Download previous Helm index run: curl -O -L -f ${{ inputs.page-url }}/index.yaml - if: ${{ ! inputs.skip-download }} + if: ${{ inputs.skip-download == 'false' }} shell: bash working-directory: ${{ inputs.charts-dir }} - name: Find previous package versions id: packages uses: mikefarah/yq@v4.28.1 - if: ${{ ! inputs.skip-download }} + if: ${{ inputs.skip-download == 'false' }} with: cmd: yq '.entries.[] | map(.urls.[]) | join(",")' ${{ inputs.charts-dir }}/index.yaml @@ -135,7 +135,7 @@ jobs: - name: Download packages run: curl -O -L -f "${{ inputs.page-url }}/{${{ steps.packages.outputs.result }}}" - if: ${{ ! inputs.skip-download }} + if: ${{ inputs.skip-download == 'false' }} shell: bash working-directory: ${{ inputs.charts-dir }}/${{ inputs.artifact-dir }} diff --git a/.github/workflows/python-poetry-release.yaml b/.github/workflows/python-poetry-release.yaml index ef171a200..13c0db60e 100644 --- a/.github/workflows/python-poetry-release.yaml +++ b/.github/workflows/python-poetry-release.yaml @@ -92,7 +92,7 @@ jobs: - name: Create changelog id: build-changelog uses: bakdata/ci-templates/actions/changelog-generate@1.49.0 - if: ${{ inputs.changelog }} + if: ${{ inputs.changelog == 'true' }} with: github-token: ${{ secrets.github-token }} tag: ${{ steps.bump-version.outputs.release-version }} diff --git a/.github/workflows/release-tag-versions.yaml b/.github/workflows/release-tag-versions.yaml index 5ff97fb83..ec2ee512f 100644 --- a/.github/workflows/release-tag-versions.yaml +++ b/.github/workflows/release-tag-versions.yaml @@ -42,7 +42,7 @@ jobs: persist-credentials: false - name: Verify current version - if: ${{ inputs.release-type == 'patch'}} + if: ${{ inputs.release-type == 'patch' }} id: suffixstep run: | VERSION_VAR=$(sed -n 's/^current_version = \(.*\)/\1/p' < .bumpversion.cfg) diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index 9214bb7c1..f2c8ed136 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -20,7 +20,7 @@ inputs: clean: description: "Clean the repository before running the action." required: false - default: false + default: "false" outputs: merged-changelog: @@ -35,7 +35,7 @@ runs: steps: - name: Check out repository uses: bakdata/ci-templates/actions/checkout@tiedemann/changelog-action-fix - if: ${{ inputs.checkout}} + if: ${{ inputs.checkout }} with: fetch-depth: 0 clean: ${{ inputs.clean }} From 5307b47fce82a166db13b38a38eb439c9148bcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 10:57:38 +0100 Subject: [PATCH 04/13] Test release workflow --- .github/workflows/bump-version-release.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-version-release.yaml b/.github/workflows/bump-version-release.yaml index fc514cf48..48f027d7c 100644 --- a/.github/workflows/bump-version-release.yaml +++ b/.github/workflows/bump-version-release.yaml @@ -66,15 +66,25 @@ jobs: release-type: ${{ inputs.release-type }} working-directory: ${{ inputs.working-directory }} + - name: Debug + shell: bash + run: | + git status + - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@1.49.0 + uses: bakdata/ci-templates/actions/changelog-generate@tiedemann/changelog-action-fix if: ${{ inputs.changelog == 'true' }} with: github-token: ${{ secrets.github-token }} tag: ${{ steps.bump-version.outputs.release-version }} changelog-file: CHANGELOG.md + - name: Debug + shell: bash + run: | + git status + - name: Commit and push changes including .bumpversion.cfg file uses: bakdata/ci-templates/actions/commit-and-push@v1.6.0 with: From 76ae72d0b0cdd7bcbda3934f1d11d2b0ee24b2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 11:01:59 +0100 Subject: [PATCH 05/13] Test release workflow --- .github/workflows/bump-version-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bump-version-release.yaml b/.github/workflows/bump-version-release.yaml index 48f027d7c..4d27f8de1 100644 --- a/.github/workflows/bump-version-release.yaml +++ b/.github/workflows/bump-version-release.yaml @@ -11,7 +11,7 @@ on: changelog: description: "Create changelog for release." required: false - default: true + default: "true" type: boolean changelog-config: description: "Changelog config path." From c9b5469394200581c810cdfb67131eb4949c653a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 11:03:42 +0100 Subject: [PATCH 06/13] Test release workflow --- .github/workflows/bump-version-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump-version-release.yaml b/.github/workflows/bump-version-release.yaml index 4d27f8de1..4e610f87c 100644 --- a/.github/workflows/bump-version-release.yaml +++ b/.github/workflows/bump-version-release.yaml @@ -11,7 +11,7 @@ on: changelog: description: "Create changelog for release." required: false - default: "true" + default: true type: boolean changelog-config: description: "Changelog config path." @@ -74,7 +74,7 @@ jobs: - name: Create changelog id: build-changelog uses: bakdata/ci-templates/actions/changelog-generate@tiedemann/changelog-action-fix - if: ${{ inputs.changelog == 'true' }} + if: ${{ inputs.changelog }} with: github-token: ${{ secrets.github-token }} tag: ${{ steps.bump-version.outputs.release-version }} From fc5cc36620de30a3de8241eeda6925259f0c853a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 11:06:16 +0100 Subject: [PATCH 07/13] Test release workflow --- .github/workflows/helm-release.yaml | 6 +++--- .github/workflows/python-poetry-release.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml index 58d352cb3..13a4922e2 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release.yaml @@ -100,14 +100,14 @@ jobs: - name: Download previous Helm index run: curl -O -L -f ${{ inputs.page-url }}/index.yaml - if: ${{ inputs.skip-download == 'false' }} + if: ${{ ! inputs.skip-download }} shell: bash working-directory: ${{ inputs.charts-dir }} - name: Find previous package versions id: packages uses: mikefarah/yq@v4.28.1 - if: ${{ inputs.skip-download == 'false' }} + if: ${{ ! inputs.skip-download }} with: cmd: yq '.entries.[] | map(.urls.[]) | join(",")' ${{ inputs.charts-dir }}/index.yaml @@ -135,7 +135,7 @@ jobs: - name: Download packages run: curl -O -L -f "${{ inputs.page-url }}/{${{ steps.packages.outputs.result }}}" - if: ${{ inputs.skip-download == 'false' }} + if: ${{ ! inputs.skip-download }} shell: bash working-directory: ${{ inputs.charts-dir }}/${{ inputs.artifact-dir }} diff --git a/.github/workflows/python-poetry-release.yaml b/.github/workflows/python-poetry-release.yaml index 13c0db60e..ef171a200 100644 --- a/.github/workflows/python-poetry-release.yaml +++ b/.github/workflows/python-poetry-release.yaml @@ -92,7 +92,7 @@ jobs: - name: Create changelog id: build-changelog uses: bakdata/ci-templates/actions/changelog-generate@1.49.0 - if: ${{ inputs.changelog == 'true' }} + if: ${{ inputs.changelog }} with: github-token: ${{ secrets.github-token }} tag: ${{ steps.bump-version.outputs.release-version }} From ee1a33c57215a2d3d3f6a16d737036bfcfdf5746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 13:31:57 +0100 Subject: [PATCH 08/13] Test release workflow --- actions/changelog-generate/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index f2c8ed136..00d56a812 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -35,7 +35,7 @@ runs: steps: - name: Check out repository uses: bakdata/ci-templates/actions/checkout@tiedemann/changelog-action-fix - if: ${{ inputs.checkout }} + if: ${{ inputs.checkout == 'ture' }} with: fetch-depth: 0 clean: ${{ inputs.clean }} From c6365341f0d18880a5fc7905c6632b85bf2c27bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 13:32:16 +0100 Subject: [PATCH 09/13] Test release workflow --- actions/changelog-generate/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index 00d56a812..eb8d61ae9 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -35,7 +35,7 @@ runs: steps: - name: Check out repository uses: bakdata/ci-templates/actions/checkout@tiedemann/changelog-action-fix - if: ${{ inputs.checkout == 'ture' }} + if: ${{ inputs.checkout == 'true' }} with: fetch-depth: 0 clean: ${{ inputs.clean }} From 5b9077d6591d7d4b83dc30fa61aaec52e50bcf61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 13:35:05 +0100 Subject: [PATCH 10/13] Test release workflow --- .github/workflows/bump-version-release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bump-version-release.yaml b/.github/workflows/bump-version-release.yaml index 4e610f87c..3ddd724a9 100644 --- a/.github/workflows/bump-version-release.yaml +++ b/.github/workflows/bump-version-release.yaml @@ -58,6 +58,7 @@ jobs: with: ref: ${{ github.event.repository.default_branch }} persist-credentials: false # required for pushing to protected branch later + fetch-depth: 0 # required for changelog generation - name: Bump version id: bump-version From a003d9b06d25fad9603e5035eb71a797fbd42b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 13:39:33 +0100 Subject: [PATCH 11/13] Cleanup --- .github/workflows/bump-version-release.yaml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/bump-version-release.yaml b/.github/workflows/bump-version-release.yaml index 3ddd724a9..ed3d5e0ae 100644 --- a/.github/workflows/bump-version-release.yaml +++ b/.github/workflows/bump-version-release.yaml @@ -67,11 +67,6 @@ jobs: release-type: ${{ inputs.release-type }} working-directory: ${{ inputs.working-directory }} - - name: Debug - shell: bash - run: | - git status - - name: Create changelog id: build-changelog uses: bakdata/ci-templates/actions/changelog-generate@tiedemann/changelog-action-fix @@ -81,11 +76,6 @@ jobs: tag: ${{ steps.bump-version.outputs.release-version }} changelog-file: CHANGELOG.md - - name: Debug - shell: bash - run: | - git status - - name: Commit and push changes including .bumpversion.cfg file uses: bakdata/ci-templates/actions/commit-and-push@v1.6.0 with: From c85a9a6565ab47af42f9e59ebf62d01783e58dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20R=C3=B6der?= Date: Thu, 21 Nov 2024 13:41:01 +0100 Subject: [PATCH 12/13] Cleanup --- .github/workflows/release-tag-versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-tag-versions.yaml b/.github/workflows/release-tag-versions.yaml index ec2ee512f..5ff97fb83 100644 --- a/.github/workflows/release-tag-versions.yaml +++ b/.github/workflows/release-tag-versions.yaml @@ -42,7 +42,7 @@ jobs: persist-credentials: false - name: Verify current version - if: ${{ inputs.release-type == 'patch' }} + if: ${{ inputs.release-type == 'patch'}} id: suffixstep run: | VERSION_VAR=$(sed -n 's/^current_version = \(.*\)/\1/p' < .bumpversion.cfg) From 5a3e0f81f810621170c3a2d8800b8a0062083d61 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Tue, 26 Nov 2024 09:51:12 +0100 Subject: [PATCH 13/13] chore: bump to future version (1.49.0) --- .github/workflows/bump-version-release.yaml | 2 +- actions/changelog-generate/action.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump-version-release.yaml b/.github/workflows/bump-version-release.yaml index ed3d5e0ae..691c570be 100644 --- a/.github/workflows/bump-version-release.yaml +++ b/.github/workflows/bump-version-release.yaml @@ -69,7 +69,7 @@ jobs: - name: Create changelog id: build-changelog - uses: bakdata/ci-templates/actions/changelog-generate@tiedemann/changelog-action-fix + uses: bakdata/ci-templates/actions/changelog-generate@1.49.0 if: ${{ inputs.changelog }} with: github-token: ${{ secrets.github-token }} diff --git a/actions/changelog-generate/action.yaml b/actions/changelog-generate/action.yaml index eb8d61ae9..b4f339188 100644 --- a/actions/changelog-generate/action.yaml +++ b/actions/changelog-generate/action.yaml @@ -34,7 +34,7 @@ runs: using: "composite" steps: - name: Check out repository - uses: bakdata/ci-templates/actions/checkout@tiedemann/changelog-action-fix + uses: bakdata/ci-templates/actions/checkout@1.49.0 if: ${{ inputs.checkout == 'true' }} with: fetch-depth: 0