Skip to content

Commit

Permalink
contributing: Generate ChangeLog in release workflow (#2402)
Browse files Browse the repository at this point in the history
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.

Fetch all history in the workflow to get a correct log.
  • Loading branch information
wenzeslaus authored Jun 1, 2022
1 parent 388e2e6 commit 07518d1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/create_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,6 +36,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/')
Expand Down Expand Up @@ -72,12 +80,24 @@ 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.gz
asset_name: ChangeLog.gz
asset_content_type: application/gzip

- name: Make the created files available
uses: actions/upload-artifact@v3
if: always()
with:
name: artifacts
path: |
core_modules_with_last_commit.*
ChangeLog.gz
if-no-files-found: warn
retention-days: 10
10 changes: 4 additions & 6 deletions doc/howto_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,14 @@ Confirm the version (it should match exactly the tag specified above):
echo "$VERSION"
```

### Create a changelog file
### Get 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):
fetch the file from the release which was generated by a workflow
linked to the tag:

```bash
python3 utils/gitlog2changelog.py
mv ChangeLog ChangeLog_$VERSION
head ChangeLog_$VERSION
gzip ChangeLog_$VERSION
wget https://github.com/OSGeo/grass/releases/download/${VERSION}/ChangeLog.gz -O ChangeLog_${VERSION}.gz
```

### Get the source code tarball
Expand Down

0 comments on commit 07518d1

Please sign in to comment.