Skip to content

Commit

Permalink
CI/CD: Generate release changelog from commits. resolves #34
Browse files Browse the repository at this point in the history
  • Loading branch information
ngosang committed Jan 8, 2021
1 parent 39fdde9 commit a8bc6f5
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/release.yml
Expand Up @@ -7,26 +7,31 @@ on:

jobs:
build:
name: Create Release
name: Create release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # get all commits, branches and tags (required for the changelog)

- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@main
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: Build changelog
id: github_changelog
run: |
changelog=$(git log $(git describe --tags --abbrev=0)..HEAD --no-merges --oneline)
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo "##[set-output name=changelog;]${changelog}"
- name: Create Release
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.github_release.outputs.changelog }}
body: ${{ steps.github_changelog.outputs.changelog }}
draft: false
prerelease: false

0 comments on commit a8bc6f5

Please sign in to comment.