19 Commits

Author SHA1 Message Date
Gitea CI
bdc46d7f37 Bump version: 0.1.23 → 0.1.24 2025-05-29 08:58:46 +00:00
Gitea CI
4259f49d94 Bump version: 0.1.22 → 0.1.23 2025-05-29 08:52:44 +00:00
95e2cdcdce Fix changelog action usage by specifying the full GitHub URL for the action 2025-05-29 10:52:21 +02:00
Gitea CI
55d0cb50e6 Bump version: 0.1.21 → 0.1.22 2025-05-29 08:48:29 +00:00
3424805d4e bump version of changelog generator 2025-05-29 10:47:35 +02:00
Gitea CI
5c0fcbdb66 Bump version: 0.1.20 → 0.1.21 2025-05-29 08:46:59 +00:00
f35e19d44d Refactor changelog action to use environment variable for Gitea token 2025-05-29 10:45:52 +02:00
Gitea CI
ef54d663d2 Bump version: 0.1.19 → 0.1.20 2025-05-29 08:43:15 +00:00
2ab0dcd60b Fix changelog action ID and update token secret for Gitea integration 2025-05-29 10:42:50 +02:00
Gitea CI
9a2b6eeafc Bump version: 0.1.18 → 0.1.19 2025-05-29 08:40:05 +00:00
4c6d4a7c6f test rcb 2025-05-29 10:39:04 +02:00
b3decbcd05 Update .gitea/workflows/bumptest.yml 2025-05-29 09:29:47 +01:00
2aed04e150 Update .gitea/workflows/bumptest.yml
Some checks failed
Bump version / build (release) Failing after 35s
2025-05-29 09:26:59 +01:00
5c983986bd test gitchglog 2025-05-29 10:25:46 +02:00
e466a8eada add chglog data 2025-05-29 10:22:34 +02:00
2ee3630392 test new changelog action 2025-05-29 10:16:40 +02:00
d1a0746b3e update wf 2025-05-29 10:11:32 +02:00
9fbf7681ed Update .gitea/workflows/bumptest.yml 2025-05-29 09:09:40 +01:00
387462cfc9 rename dispatch steps 2025-05-29 10:08:03 +02:00
7 changed files with 159 additions and 78 deletions

View File

@@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.1.18"
current_version = "0.1.24"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"

38
.chglog/CHANGELOG.tpl.md Executable file
View File

@@ -0,0 +1,38 @@
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
* {{ .Subject }}
{{ end }}
{{ end -}}
{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
* {{ .Revert.Header }}
{{ end }}
{{ end -}}
{{- if .MergeCommits -}}
### Pull Requests
{{ range .MergeCommits -}}
* {{ .Header }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}

27
.chglog/config.yml Executable file
View File

@@ -0,0 +1,27 @@
style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://git.theprivateserver.de/PHB/workflowbumptester
options:
commits:
# filters:
# Type:
# - feat
# - fix
# - perf
# - refactor
commit_groups:
# title_maps:
# feat: Features
# fix: Bug Fixes
# perf: Performance Improvements
# refactor: Code Refactoring
header:
pattern: "^(\\w*)\\:\\s(.*)$"
pattern_maps:
- Type
- Subject
notes:
keywords:
- BREAKING CHANGE

View File

@@ -0,0 +1,29 @@
{
"categories": [
{
"title": "## 🚀 Features",
"labels": ["add","Add"]
},
{
"title": "## 🐛 Fixes",
"labels": ["fix","Fix"]
},
{
"title": "## 🧪 Upgrade",
"labels": ["upgrade","Upgrade","Clean"]
}
],
"label_extractor": [
{
"pattern": "(\\w+) (.+)",
"target": "$1",
"on_property": "title"
}
],
"sort": "ASC",
"template": "${{CHANGELOG}}",
"pr_template": "- ${{TITLE}}\n - PR: #${{NUMBER}}",
"empty_template": "- no changes",
"max_pull_requests": 1000,
"max_back_track_time_days": 1000
}

View File

@@ -1,17 +1,10 @@
name: Bump version
on:
release:
types: [published]
workflow_dispatch:
inputs:
bump-type:
description: 'Bump type'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
jobs:
build:
@@ -19,56 +12,59 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install
with:
python-version-file: "pyproject.toml"
- name: Setup git-chglog
run: |
CHGLOG_VERSION="0.15.4"
curl -o git-chglog -L "https://github.com/git-chglog/git-chglog/releases/download/${CHGLOG_VERSION}/git-chglog_linux_amd64"
chmod +x git-chglog
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Set Git identity
- name: show structure
run: ls -la
- name: Generate CHANGELOG.md
id: generate
run: |
git config user.name "Gitea CI"
git config user.email "ci@git.theprivateserver.de"
- name: Bump version
id: bump
run: |
uv tool install bump-my-version
echo "OLD_VERSION<<EOF" >> $GITHUB_ENV
echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
uv tool run bump-my-version bump ${{ github.event.inputs.bump }}
# echo the version to github env, the version is shown by using uv tool run bump-my-version show current_version
echo "VERSION<<EOF" >> $GITHUB_ENV
echo "$(uv tool run bump-my-version show current_version)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Check version
run: echo old ${{ env.OLD_VERSION }} new ${{ env.VERSION }}
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ secrets.TOKEN }}
fromTag: ${{ env.OLD_VERSION }}
toTag: ${{ env.VERSION }}
writeToFile: true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Create release
id: create_release
if: ${{ github.event.inputs.github_release == 'true' }}
uses: softprops/action-gh-release@master
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
make_latest: true
rm -f CHANGELOG.md
./git-chglog -o CHANGELOG.md
if git diff --quiet CHANGELOG.md; then
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "changes=true" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
run: rm git-chglog
if: always()
- name: Create Pull Request
if: steps.generate.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update CHANGELOG.md"
title: "📝 Update Changelog"
body: |
This PR updates the CHANGELOG.md to include all releases.
- Generated using git-chglog
- Triggered by: ${{ github.event_name }}
- Auto-merge enabled
branch: update-changelog-${{ github.run_id }}
base: main
delete-branch: true
labels: documentation, automated-pr
- name: Enable Auto-merge
if: steps.generate.outputs.changes == 'true'
uses: pascalgn/automerge-action@v0.15.0
with:
mergeMethod: squash
token: ${{ secrets.GITHUB_TOKEN }}
pullRequestNumber: ${{ steps.create-pull-request.outputs.pullRequestNumber }}
commitMessage: "chore: update CHANGELOG.md"
title: "📝 Update Changelog"
body: |
This PR updates the CHANGELOG.md to include all releases.
- Generated using git-chglog
- Triggered by: ${{ github.event_name }}

View File

@@ -59,24 +59,15 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: "Build Changelog"
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v5.0.0
uses: https://github.com/mikepenz/release-changelog-builder-action@v5
with:
platform: "gitea"
baseURL: "http://gitea:3000"
configuration: ".gitea/changelog-config.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add release notes to environment
id: add_release_notes
run: |
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "${{ github.event.inputs.release_notes }}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Get the changelog
run: |
cat << "EOF"
${{ steps.changelog.outputs.changelog }}
EOF
echo ${{ steps.changelog.outputs.changelog }}
GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }}
- name: Create release

View File

@@ -1 +1 @@
0.1.18
0.1.24