chore(workflows): add CI workflows and configuration files
- Add default merge message template for PRs - Introduce workflow for major version tag creation on release - Add workflow for auto changelog and release generation - Add git-cliff configuration for changelog formatting - Configure `.vscode` workspace settings and `.gitignore` updates
This commit is contained in:
5
.gitea/default_merge_message/MERGE_TEMPLATE.md
Normal file
5
.gitea/default_merge_message/MERGE_TEMPLATE.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
chore(pr): ${PullRequestTitle} ${PullRequestReference}
|
||||||
|
|
||||||
|
${PullRequestDescription}
|
||||||
|
|
||||||
|
Merged from ${HeadBranch} into ${BaseBranch}
|
61
.gitea/workflows/create-major-tag.yml
Normal file
61
.gitea/workflows/create-major-tag.yml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
name: Create Major Version Tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-major-tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # required to delete/create tags
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# ▸ 1. Check out the repository at the release tag
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # fetch all tags
|
||||||
|
ref: ${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
# ▸ 2. Extract the major version from the release tag
|
||||||
|
- name: Derive major version
|
||||||
|
id: derive
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
TAG="${{ github.event.release.tag_name }}" # e.g., v2.3.4
|
||||||
|
echo "Release tag: $TAG"
|
||||||
|
|
||||||
|
TAG_NOPREFIX="${TAG#v}" # remove leading v/V
|
||||||
|
MAJOR="${TAG_NOPREFIX%%.*}" # take part before the first dot
|
||||||
|
MAJOR_TAG="v${MAJOR}" # e.g., v2
|
||||||
|
|
||||||
|
echo "Major tag: $MAJOR_TAG"
|
||||||
|
echo "major_tag=$MAJOR_TAG" >>"$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# ▸ 3. Delete the old major tag (if it exists) and create a new one
|
||||||
|
- name: Re-create major tag
|
||||||
|
env:
|
||||||
|
MAJOR_TAG: ${{ steps.derive.outputs.major_tag }}
|
||||||
|
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
git config user.name "$CI_COMMIT_AUTHOR_NAME"
|
||||||
|
git config user.email "$CI_COMMIT_AUTHOR_EMAIL"
|
||||||
|
|
||||||
|
# Determine the specific commit of the release tag
|
||||||
|
COMMIT_SHA="$(git rev-list -n 1 "$RELEASE_TAG")"
|
||||||
|
|
||||||
|
echo "Commit of the release tag: $COMMIT_SHA"
|
||||||
|
|
||||||
|
# (a) Locally and remotely remove the old major tag (if it exists)
|
||||||
|
git tag -d "$MAJOR_TAG" 2>/dev/null || true
|
||||||
|
git push --delete origin "$MAJOR_TAG" 2>/dev/null || true
|
||||||
|
|
||||||
|
# (b) Create and push a new annotated tag
|
||||||
|
git tag -a "$MAJOR_TAG" "$COMMIT_SHA" \
|
||||||
|
-m "Update $MAJOR_TAG → $RELEASE_TAG"
|
||||||
|
git push origin "$MAJOR_TAG"
|
||||||
|
|
||||||
|
echo "✅ $MAJOR_TAG now points to $RELEASE_TAG ($COMMIT_SHA)"
|
19
.gitea/workflows/release.yml
Normal file
19
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Auto Changelog & Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- "**"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Release
|
||||||
|
uses: https://git.0xmax42.io/actions/auto-changelog-release-action@v0
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.RELEASE_PUBLISH_TOKEN }}
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
**/*.env
|
11
.vscode/settings.json
vendored
Normal file
11
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"workbench.colorCustomizations": {
|
||||||
|
"activityBar.activeBackground": "#528859",
|
||||||
|
"activityBar.background": "#528859",
|
||||||
|
"activityBar.foreground": "#e7e7e7",
|
||||||
|
"activityBar.inactiveForeground": "#e7e7e799",
|
||||||
|
"activityBarBadge.background": "#c6c3db",
|
||||||
|
"activityBarBadge.foreground": "#15202b"
|
||||||
|
},
|
||||||
|
"peacock.color": "#3f6844"
|
||||||
|
}
|
104
cliff.toml
Normal file
104
cliff.toml
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
# CLIFF_VERSION=2.8.0
|
||||||
|
# git-cliff ~ default configuration file
|
||||||
|
# https://git-cliff.org/docs/configuration
|
||||||
|
#
|
||||||
|
# Lines starting with "#" are comments.
|
||||||
|
# Configuration options are organized into tables and keys.
|
||||||
|
# See documentation for more information on available options.
|
||||||
|
[remote.gitea]
|
||||||
|
owner = "actions"
|
||||||
|
repo = "deb-changelog-action"
|
||||||
|
|
||||||
|
[changelog]
|
||||||
|
# postprocessors
|
||||||
|
postprocessors = [
|
||||||
|
{ pattern = '<GITEA_URL>', replace = "https://git.0xmax42.io" }, # replace gitea url
|
||||||
|
]
|
||||||
|
|
||||||
|
# template for the changelog header
|
||||||
|
header = """
|
||||||
|
# Changelog\n
|
||||||
|
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 = """
|
||||||
|
{%- macro remote_url() -%}
|
||||||
|
<GITEA_URL>/{{ remote.gitea.owner }}/{{ remote.gitea.repo }}
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
|
{% if version %}\
|
||||||
|
{% if previous.version %}\
|
||||||
|
## [{{ version | trim_start_matches(pat="v") }}]\
|
||||||
|
({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||||
|
{% else %}\
|
||||||
|
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||||
|
{% endif %}\
|
||||||
|
{% else %}\
|
||||||
|
## [unreleased]
|
||||||
|
{% endif %}\
|
||||||
|
{% for group, commits in commits | group_by(attribute="group") %}
|
||||||
|
### {{ group | striptags | trim | upper_first }}
|
||||||
|
{% for commit in commits %}
|
||||||
|
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
|
||||||
|
{% if commit.breaking %}[**breaking**] {% endif %}\
|
||||||
|
{{ commit.message | upper_first }} - \
|
||||||
|
([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}\n
|
||||||
|
"""
|
||||||
|
# template for the changelog footer
|
||||||
|
footer = """
|
||||||
|
|
||||||
|
"""
|
||||||
|
# remove the leading and trailing s
|
||||||
|
trim = true
|
||||||
|
|
||||||
|
# render body even when there are no releases to process
|
||||||
|
# render_always = true
|
||||||
|
# output file path
|
||||||
|
# output = "test.md"
|
||||||
|
|
||||||
|
[git]
|
||||||
|
# parse the commits based on https://www.conventionalcommits.org
|
||||||
|
conventional_commits = true
|
||||||
|
# filter out the commits that are not conventional
|
||||||
|
filter_unconventional = true
|
||||||
|
# process each line of a commit as an individual commit
|
||||||
|
split_commits = false
|
||||||
|
# regex for preprocessing the commit messages
|
||||||
|
commit_preprocessors = [
|
||||||
|
# Replace issue numbers
|
||||||
|
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
|
||||||
|
# Check spelling of the commit with https://github.com/crate-ci/typos
|
||||||
|
# If the spelling is incorrect, it will be automatically fixed.
|
||||||
|
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
|
||||||
|
]
|
||||||
|
# regex for parsing and grouping commits
|
||||||
|
commit_parsers = [
|
||||||
|
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
|
||||||
|
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
|
||||||
|
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
|
||||||
|
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
|
||||||
|
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
|
||||||
|
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
|
||||||
|
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
|
||||||
|
{ message = "^chore\\(changelog\\)", skip = true },
|
||||||
|
{ message = "^chore\\(version\\)", skip = true },
|
||||||
|
{ message = "^chore\\(release\\): prepare for", skip = true },
|
||||||
|
{ message = "^chore\\(deps.*\\)", skip = true },
|
||||||
|
{ message = "^chore\\(pr\\)", skip = true },
|
||||||
|
{ message = "^chore\\(pull\\)", skip = true },
|
||||||
|
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
|
||||||
|
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
|
||||||
|
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
|
||||||
|
{ message = ".*", group = "<!-- 10 -->💼 Other" },
|
||||||
|
]
|
||||||
|
# Regex to select git tags that represent releases.
|
||||||
|
tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||||
|
# filter out the commits that are not matched by commit parsers
|
||||||
|
filter_commits = false
|
||||||
|
# sort the tags topologically
|
||||||
|
topo_order = false
|
||||||
|
# sort the commits inside sections by oldest/newest order
|
||||||
|
sort_commits = "newest"
|
Reference in New Issue
Block a user