From cfda90b998406669d41082ab2254d3cdf500d33c Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 11 Jan 2020 14:29:58 +0100 Subject: [PATCH 1/7] [JENKINS-60740] - Use actions/upload-release-asset to upload changelog YAMLs to Release Drafter --- .github/workflows/changelog.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 18926fbe81..bb2fa25eb9 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -14,11 +14,24 @@ jobs: steps: # Drafts your next Release notes as Pull Requests are merged into "master" - name: Generate GitHub Release Draft + id: release-drafter uses: release-drafter/release-drafter@v5.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Generates a YAML changelog file using https://github.com/jenkinsci/jenkins-core-changelog-generator - name: Generate YAML changelog draft + id: jenkins-core-changelog-generator uses: jenkinsci/jenkins-core-changelog-generator@master env: GITHUB_AUTH: github-actions:${{ secrets.GITHUB_TOKEN }} + # Upload YAML to the release draft assets + - name: Upload changelog.yaml to the Release Draft + id: upload-changelog.yaml + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.release-drafter.outputs.upload_url }} + asset_path: ./changelog.yaml + asset_name: changelog.yaml + asset_content_type: text/yaml From 48818ac378058e9c9a9ac7c8641d2b77c7f4e55b Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 11 Jan 2020 14:31:35 +0100 Subject: [PATCH 2/7] [JENKINS-60740] - Fix the action ID --- .github/workflows/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index bb2fa25eb9..f132f3fa0d 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -26,7 +26,7 @@ jobs: GITHUB_AUTH: github-actions:${{ secrets.GITHUB_TOKEN }} # Upload YAML to the release draft assets - name: Upload changelog.yaml to the Release Draft - id: upload-changelog.yaml + id: upload-changelog-yaml uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ea6923eb309e0e832ffbd6efded9aceaeb5eb8f3 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 11 Jan 2020 14:45:00 +0100 Subject: [PATCH 3/7] [JENKINS-60740] - Switch Release Drafter to a standard Markdown layout --- .github/release-drafter.yml | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 84656fc8eb..08d586f577 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,29 +1,16 @@ # Configuration for Release Drafter: https://github.com/toolmantim/release-drafter -name-template: $NEXT_PATCH_VERSION -# Uses a more common 2-digit versioning in Jenkins weekly releases. +extends: .github +# We use the 2-digit versioning in Jenkins weekly releases. version-template: $MAJOR.$MINOR +name-template: $NEXT_MINOR_VERSION tag-template: jenkins-$NEXT_MINOR_VERSION -exclude-labels: - - reverted - - no-changelog - - skip-changelog - - invalid -change-template: |- - - type: todo - message: |- - $TITLE - pull: $NUMBER - authors: - - $AUTHOR - template: | **Disclaimer**: This is an automatically generated changelog draft for Jenkins weekly releases. - See https://jenkins.io/changelog/ for the official changelogs. + See https://jenkins.io/changelog/ for the official changelogs. + See the attached `changelog.yaml` for a draft machine-readable changelog for jenkins.io - ```yaml $CHANGES - ``` # Categories will be commented out, because we use YAML # Now we use categories only for sorting @@ -44,17 +31,3 @@ categories: label: developer - title: Internal changes label: internal - -replacers: - - search: '/\[*JENKINS-(\d+)\]*\s*-*\s*/g' - replace: |- - issue: $1 - message: |- - - - search: |- - message: |- - issue: - replace: "issue:" - - - search: "##" - replace: "#" From c4255001cb76436fd8a74505a7e69081d80821fc Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 11 Jan 2020 14:47:25 +0100 Subject: [PATCH 4/7] [JENKINS-60740] - List all contributors in the bottom of the release draft --- .github/release-drafter.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 08d586f577..597bd02629 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -11,6 +11,8 @@ template: | See the attached `changelog.yaml` for a draft machine-readable changelog for jenkins.io $CHANGES + + All contributors: $CONTRIBUTORS # Categories will be commented out, because we use YAML # Now we use categories only for sorting From 17b6ac6a3bde02681788fce81d88fbfe1ceec6be Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 11 Jan 2020 15:21:40 +0100 Subject: [PATCH 5/7] [JENKINS-60740] - Update Release Drafter to the recent version --- .github/workflows/changelog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index f132f3fa0d..4b8aa8bb02 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -15,7 +15,7 @@ jobs: # Drafts your next Release notes as Pull Requests are merged into "master" - name: Generate GitHub Release Draft id: release-drafter - uses: release-drafter/release-drafter@v5.4.0 + uses: release-drafter/release-drafter@v5.6.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Generates a YAML changelog file using https://github.com/jenkinsci/jenkins-core-changelog-generator From b0c9bf1e2ecf5b754ead26685d02ae7263d2ef4c Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 11 Jan 2020 15:26:09 +0100 Subject: [PATCH 6/7] [JENKINS-60740] - Publish changelog YAMLs to artifacts instead of the release metadata --- .github/workflows/changelog.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 4b8aa8bb02..1c16d431d0 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -24,14 +24,20 @@ jobs: uses: jenkinsci/jenkins-core-changelog-generator@master env: GITHUB_AUTH: github-actions:${{ secrets.GITHUB_TOKEN }} - # Upload YAML to the release draft assets - - name: Upload changelog.yaml to the Release Draft - id: upload-changelog-yaml - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Changelog YAML + uses: actions/upload-artifact@v1 with: - upload_url: ${{ steps.release-drafter.outputs.upload_url }} - asset_path: ./changelog.yaml - asset_name: changelog.yaml - asset_content_type: text/yaml + name: changelog.yaml + path: changelog.yaml +#TODO(oleg-nenashev): It will not work well with Release Drafter which does not recreated releases. Asset does not get overwritten, and there is no ready-to-go API for overriding assets + # Upload YAML to the release draft assets +# - name: Upload changelog.yaml to the Release Draft +# id: upload-changelog-yaml +# uses: actions/upload-release-asset@v1.0.1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ steps.release-drafter.outputs.upload_url }} +# asset_path: ./changelog.yaml +# asset_name: changelog.yaml +# asset_content_type: text/yaml From 456717aff616e708c071490c5c69c44bc7160483 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Sat, 11 Jan 2020 15:40:10 +0100 Subject: [PATCH 7/7] [JENKINS-60740] - Edit the release drafter text --- .github/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 597bd02629..efd512f8c4 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -8,7 +8,7 @@ tag-template: jenkins-$NEXT_MINOR_VERSION template: | **Disclaimer**: This is an automatically generated changelog draft for Jenkins weekly releases. See https://jenkins.io/changelog/ for the official changelogs. - See the attached `changelog.yaml` for a draft machine-readable changelog for jenkins.io + For `changelog.yaml` drafts see GitHub action artifacts attached to release commits. $CHANGES