Merge pull request #4 from prinzpiuz/prinz/like_counter #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Commit Changelog And Version | |
on: | |
push: | |
branches: | |
- staging | |
jobs: | |
tag: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Bump version and push tag | |
id: autoversion | |
uses: anothrNick/github-tag-action@1.64.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
WITH_V: false | |
DRY_RUN: false | |
INITIAL_VERSION: 0.0.0 | |
outputs: | |
new_tag: ${{ steps.autoversion.outputs.new_tag }} | |
commit_changelog_and_version: | |
needs: tag | |
runs-on: ubuntu-latest | |
name: Generate changelog and update version | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Generate a changelog | |
uses: orhun/git-cliff-action@main | |
id: git-cliff | |
with: | |
config: cliff.toml | |
args: --latest -t ${{ needs.tag.outputs.new_tag }} | |
env: | |
OUTPUT: CHANGES.md | |
- name: Copy changelog to workspace | |
run: echo "${{ steps.git-cliff.outputs.content }}" >> CHANGELOG.md | |
- name: Update blog version in config.toml | |
run: | | |
sed -i '/version./c\ version="${{ needs.tag.outputs.new_tag }}"' config.toml | |
- name: Commit changes | |
if: ${{ success() }} | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '["CHANGELOG.md", "config.toml"]' | |
pull: "--rebase --autostash ." | |
message: "chore(generated): changelog generated & version updated automatically" | |
default_author: github_actions |