Skip to content

Commit

Permalink
ci: use git-cliff action
Browse files Browse the repository at this point in the history
  • Loading branch information
Itsusinn committed Sep 6, 2024
1 parent 8802158 commit 511b9e4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: true

fetch-depth: 0
fetch-tags: true
- name: Merge binaries
uses: actions/upload-artifact/merge@v4
with:
Expand All @@ -273,34 +273,42 @@ jobs:
git push origin :refs/tags/latest || true
git tag latest
git push origin latest
gh release list | grep Draft | awk '{print $1 " \t"}' | while read -r line; do gh release delete -y "$line"; done
env:
GH_TOKEN: ${{ github.token }}

- name: Generate a changelog
uses: orhun/git-cliff-action@main
id: git-cliff
with:
config: cliff.toml
args: -vv --latest --no-exec --github-repo ${{ github.repository }}
args: --latest --strip header
env:
GITHUB_REPO: ${{ github.repository }}

- name: Github stable release
uses: "mathieucarbou/marvinpinto-action-automatic-releases@master"
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
body: "${{ steps.git-cliff.outputs.content }}"
files: |
packages/*
LICENSE
LICENSE*
- name: Github nightly release
uses: "mathieucarbou/marvinpinto-action-automatic-releases@master"
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/heads/master')
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "latest"
tag_name: "latest"
generate_release_notes: false
body: "${{ steps.git-cliff.outputs.content }}"
files: |
packages/*
LICENSE
LICENSE*
docker-image:
needs: [ compile ]
name: Docker Image
Expand Down
12 changes: 6 additions & 6 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ All notable changes to this project will be documented in this file.\n
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
{% if commit.github.pr_labels is containing("dependencies") %}
{% continue %}
{% endif %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }}\
Expand All @@ -30,7 +28,9 @@ body = """
"""
# template for the changelog footer
footer = """
<!-- generated by git-cliff -->
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }}
{%- endfor -%}
"""
# remove the leading and trailing s
trim = true
Expand Down

0 comments on commit 511b9e4

Please sign in to comment.