From 74320ff04f732468a638fdee9a371b1b50e48dfb Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 12 Nov 2025 15:41:54 +0100 Subject: [PATCH 1/6] automate contributors in relnotes --- .github/workflows/github_release.yml | 37 ++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml index f301611f02..dae9053626 100644 --- a/.github/workflows/github_release.yml +++ b/.github/workflows/github_release.yml @@ -8,6 +8,7 @@ on: # Ignore release versions tagged with -rc0 suffix - "!v2.[0-9]+.[0-9]-rc0" + pull_request: jobs: generate-notes: runs-on: ubuntu-latest @@ -59,16 +60,36 @@ jobs: reno report --no-show-source --ignore-cache --version v${{ steps.version.outputs.current_release }} -o relnotes.rst - name: Convert to Markdown - uses: docker://pandoc/core:3.1 + uses: docker://pandoc/core:3.8 with: - args: "--from rst --to markdown_github --no-highlight relnotes.rst -o relnotes.md --wrap=none" + args: "--from rst --to gfm --syntax-highlighting=none --wrap=none relnotes.rst -o relnotes.md" + + - name: Add contributor list + # only for minor releases and minor release candidates (not bugfix releases) + if: endsWith(steps.version.outputs.current_release, '.0') + env: + GH_TOKEN: ${{ github.token }} + START: v${{ steps.version.outputs.current_release }}-rc0 + END: "v2.20.x" + # END: ${{ github.ref_name }} + run: | + CONTRIBUTORS=$(gh api "repos/deepset-ai/haystack/compare/$START...$END" \ + --jq '[.commits[].author.login] | map(select(. != null)) | unique | map("@\(.)") | join(", ")') + + cat relnotes.md > enhanced_relnotes.md + { + echo "" + echo "## 💙 Big thank you to everyone who contributed to this release!" + echo "" + echo "$CONTRIBUTORS" + } >> enhanced_relnotes.md - name: Debug run: | - cat relnotes.md + cat enhanced_relnotes.md - - uses: ncipollo/release-action@v1 - with: - bodyFile: "relnotes.md" - prerelease: ${{ steps.version.outputs.current_pre_release }} - allowUpdates: true + # - uses: ncipollo/release-action@v1 + # with: + # bodyFile: "relnotes.md" + # prerelease: ${{ steps.version.outputs.current_pre_release != '' }} + # allowUpdates: true From 344dd9bdbfec2f2a6f008ba4f654b2d17a011f96 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 12 Nov 2025 15:46:16 +0100 Subject: [PATCH 2/6] improve jq query --- .github/workflows/github_release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml index dae9053626..4024c3cfd8 100644 --- a/.github/workflows/github_release.yml +++ b/.github/workflows/github_release.yml @@ -74,7 +74,12 @@ jobs: # END: ${{ github.ref_name }} run: | CONTRIBUTORS=$(gh api "repos/deepset-ai/haystack/compare/$START...$END" \ - --jq '[.commits[].author.login] | map(select(. != null)) | unique | map("@\(.)") | join(", ")') + --jq '[.commits[].author.login] \ + | map(select(. != null and . != "HaystackBot" and . != "dependabot[bot]")) \ + | unique \ + | sort_by(ascii_downcase) \ + | map("@\(.)") \ + | join(", ")') cat relnotes.md > enhanced_relnotes.md { From 2090de1a5d277a0a2d95054aca45fdc77e5a863b Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 12 Nov 2025 15:48:59 +0100 Subject: [PATCH 3/6] retry --- .github/workflows/github_release.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml index 4024c3cfd8..1fd6c0e364 100644 --- a/.github/workflows/github_release.yml +++ b/.github/workflows/github_release.yml @@ -73,13 +73,14 @@ jobs: END: "v2.20.x" # END: ${{ github.ref_name }} run: | + JQ_EXPR='[.commits[].author.login] + | map(select(. != null and . != "HaystackBot" and . != "dependabot[bot]")) + | unique + | sort_by(ascii_downcase) + | map("@\(.)") + | join(", ")' CONTRIBUTORS=$(gh api "repos/deepset-ai/haystack/compare/$START...$END" \ - --jq '[.commits[].author.login] \ - | map(select(. != null and . != "HaystackBot" and . != "dependabot[bot]")) \ - | unique \ - | sort_by(ascii_downcase) \ - | map("@\(.)") \ - | join(", ")') + --jq "$JQ_EXPR") cat relnotes.md > enhanced_relnotes.md { From 6ad2b32a808fb0a27d4ee02ec959d54c8247c1f9 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 12 Nov 2025 15:54:19 +0100 Subject: [PATCH 4/6] try with expected tag value --- .github/workflows/github_release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml index 1fd6c0e364..0009e42eb3 100644 --- a/.github/workflows/github_release.yml +++ b/.github/workflows/github_release.yml @@ -70,7 +70,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} START: v${{ steps.version.outputs.current_release }}-rc0 - END: "v2.20.x" + END: "v2.20.0-rc1" # END: ${{ github.ref_name }} run: | JQ_EXPR='[.commits[].author.login] From bf67fe2aa5fcd8215a94acd6c7e7d0293e8af43d Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 12 Nov 2025 16:11:18 +0100 Subject: [PATCH 5/6] refinements --- .github/workflows/github_release.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml index 0009e42eb3..c6fc5f4ea8 100644 --- a/.github/workflows/github_release.yml +++ b/.github/workflows/github_release.yml @@ -7,8 +7,6 @@ on: - "v2.[0-9]+.[0-9]+*" # Ignore release versions tagged with -rc0 suffix - "!v2.[0-9]+.[0-9]-rc0" - - pull_request: jobs: generate-notes: runs-on: ubuntu-latest @@ -64,14 +62,18 @@ jobs: with: args: "--from rst --to gfm --syntax-highlighting=none --wrap=none relnotes.rst -o relnotes.md" + - name: Copy relnotes file + run: | + cat relnotes.md > enhanced_relnotes.md + - name: Add contributor list - # only for minor releases and minor release candidates (not bugfix releases) + # only for minor releases and minor release candidates (not bugfix releases) if: endsWith(steps.version.outputs.current_release, '.0') env: GH_TOKEN: ${{ github.token }} START: v${{ steps.version.outputs.current_release }}-rc0 - END: "v2.20.0-rc1" # END: ${{ github.ref_name }} + END: v2.20.0-rc1 run: | JQ_EXPR='[.commits[].author.login] | map(select(. != null and . != "HaystackBot" and . != "dependabot[bot]")) @@ -82,7 +84,6 @@ jobs: CONTRIBUTORS=$(gh api "repos/deepset-ai/haystack/compare/$START...$END" \ --jq "$JQ_EXPR") - cat relnotes.md > enhanced_relnotes.md { echo "" echo "## 💙 Big thank you to everyone who contributed to this release!" @@ -94,8 +95,8 @@ jobs: run: | cat enhanced_relnotes.md - # - uses: ncipollo/release-action@v1 - # with: - # bodyFile: "relnotes.md" - # prerelease: ${{ steps.version.outputs.current_pre_release != '' }} - # allowUpdates: true + - uses: ncipollo/release-action@v1 + with: + bodyFile: "enhanced_relnotes.md" + prerelease: ${{ steps.version.outputs.current_pre_release != '' }} + allowUpdates: true From 75b779a693f4440de609da45efea372cae42448a Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 12 Nov 2025 16:12:35 +0100 Subject: [PATCH 6/6] try again --- .github/workflows/github_release.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github_release.yml b/.github/workflows/github_release.yml index c6fc5f4ea8..94ee6d106b 100644 --- a/.github/workflows/github_release.yml +++ b/.github/workflows/github_release.yml @@ -7,6 +7,8 @@ on: - "v2.[0-9]+.[0-9]+*" # Ignore release versions tagged with -rc0 suffix - "!v2.[0-9]+.[0-9]-rc0" + + pull_request: jobs: generate-notes: runs-on: ubuntu-latest @@ -95,8 +97,8 @@ jobs: run: | cat enhanced_relnotes.md - - uses: ncipollo/release-action@v1 - with: - bodyFile: "enhanced_relnotes.md" - prerelease: ${{ steps.version.outputs.current_pre_release != '' }} - allowUpdates: true + # - uses: ncipollo/release-action@v1 + # with: + # bodyFile: "enhanced_relnotes.md" + # prerelease: ${{ steps.version.outputs.current_pre_release != '' }} + # allowUpdates: true