Skip to content

Commit

Permalink
ci: added automatic changelog.md writing in release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
97gamjak committed Jun 1, 2024
1 parent 05dfd04 commit 3cdd91b
Showing 1 changed file with 34 additions and 23 deletions.
57 changes: 34 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ jobs:
with:
fetch-depth: 0

- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.12'

- name: build git-changelog
run: |
python3 -m pip install git-changelog
- name: Get previous tag
id: previousTag
run: |
Expand All @@ -75,36 +84,38 @@ jobs:
echo "previousTag=$name" >> $GITHUB_ENV
echo "::set-output name=previousTag::$name"
- name: generate new changelog
run: |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
echo "git-changelog=$(git-changelog -F "$name.. -c angular")" >> $GITHUB_ENV
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--generate-notes
# - name: Create GitHub Changelog.md
# env:
# GITHUB_TOKEN: ${{ github.token }}
# run: >-
# gh release view
# '${{ github.ref_name }}'

# - name: Add .github/.pylint_cache to the commit
# run: |
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
# git config --global user.name "github-actions[bot]"

# git add CHANGELOG.md
# git commit -m "Docs: Update CHANGELOG.md on release event"

# - name: Push changes
# if: github.event_name == 'push'
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: 'main'
--notes "${changelog}"
- name: Build CHANGELOG.md
run: |
git-changelog -o CHANGELOG.md -c angular
- name: Add CHANGELOG.md to commit
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add CHANGELOG.md
git commit -m "Docs: Update CHANGELOG.md on release event"
- name: Push changes
if: github.event_name == 'push'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'main'

pypi-release-update:
name: >-
Expand Down

0 comments on commit 3cdd91b

Please sign in to comment.