From 131efb1bd1fcf63098fee9f0cabf0628735c8844 Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Tue, 24 May 2022 23:42:37 -0400 Subject: [PATCH 1/3] contributing: Generate ChangeLog in release workflow The ChangeLog file uploaded with the tarball is now generated in the create release draft workflow and added to the release. From there it is retrieved in the release workflow and a version-specific name is used for it. --- .github/workflows/create_release_draft.yml | 18 ++++++++++++++++++ doc/howto_release.md | 22 ++++++++++------------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/.github/workflows/create_release_draft.yml b/.github/workflows/create_release_draft.yml index 2e6e6b53c96..7c0cb915752 100644 --- a/.github/workflows/create_release_draft.yml +++ b/.github/workflows/create_release_draft.yml @@ -34,6 +34,12 @@ jobs: git add core_modules_with_last_commit.json git diff --cached > core_modules_with_last_commit.patch + - name: Generate ChangeLog file + run: | + sudo apt-get install -y gzip + python utils/gitlog2changelog.py + gzip ChangeLog + - name: Create new release draft (for tags only) id: create_release if: startsWith(github.ref, 'refs/tags/') @@ -72,6 +78,17 @@ jobs: asset_name: core_modules_with_last_commit.patch asset_content_type: text/plain + - name: Upload ChangeLog file (for tags only) + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ChangeLog + asset_name: ChangeLog + asset_content_type: application/gzip + - name: Make the created files available uses: actions/upload-artifact@v3 if: always() @@ -79,5 +96,6 @@ jobs: name: artifacts path: | core_modules_with_last_commit.* + ChangeLog if-no-files-found: warn retention-days: 10 diff --git a/doc/howto_release.md b/doc/howto_release.md index a88f1a1baa3..be62138d19e 100644 --- a/doc/howto_release.md +++ b/doc/howto_release.md @@ -219,18 +219,6 @@ If RC, mark it as a pre-release, check: Save the modified draft, but do not publish the release yet. -## Changelog file for upload - -There is also a large changelog file we produce and publish, -create it with a script (it takes several minutes to complete): - -```bash -python3 utils/gitlog2changelog.py -mv ChangeLog ChangeLog_$VERSION -head ChangeLog_$VERSION -gzip ChangeLog_$VERSION -``` - ## Reset include/VERSION file to git development version Use a dedicated script to edit the VERSION file. @@ -259,6 +247,16 @@ git commit include/VERSION -m "version: Back to 8.2.0dev" git push upstream ``` +## Get changelog file for upload + +There is also a large changelog file we produce and publish, +fetch the file from the release which was generated by a workflow +linked to the tag: + +```bash +wget https://github.com/OSGeo/grass/releases/download/${VERSION}/ChangeLog.gz -O ChangeLog_${VERSION}.gz +``` + ## Get the source code tarball Fetch a tarball from GitHub we also publish on OSGeo servers: From 6732ae03559ee5ea4cd71ed08d557267a38d361b Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Wed, 25 May 2022 00:05:40 -0400 Subject: [PATCH 2/3] The changelog is gz --- .github/workflows/create_release_draft.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/create_release_draft.yml b/.github/workflows/create_release_draft.yml index 7c0cb915752..7c65dac8b45 100644 --- a/.github/workflows/create_release_draft.yml +++ b/.github/workflows/create_release_draft.yml @@ -85,8 +85,8 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ChangeLog - asset_name: ChangeLog + asset_path: ChangeLog.gz + asset_name: ChangeLog.gz asset_content_type: application/gzip - name: Make the created files available @@ -96,6 +96,6 @@ jobs: name: artifacts path: | core_modules_with_last_commit.* - ChangeLog + ChangeLog.gz if-no-files-found: warn retention-days: 10 From 0566b7bdd3f9644d213f22cfcf35dcacba4fb397 Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Wed, 25 May 2022 11:39:42 -0400 Subject: [PATCH 3/3] Fetch all history to get a correct log --- .github/workflows/create_release_draft.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/create_release_draft.yml b/.github/workflows/create_release_draft.yml index 7c65dac8b45..34cd192cbc9 100644 --- a/.github/workflows/create_release_draft.yml +++ b/.github/workflows/create_release_draft.yml @@ -22,6 +22,8 @@ jobs: steps: - name: Checks-out repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v2