test gitchglog
This commit is contained in:
@@ -1,21 +1,10 @@
|
|||||||
name: Bump version
|
name: Bump version
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
on:
|
||||||
bump:
|
release:
|
||||||
description: 'Bump type'
|
types: [published]
|
||||||
required: true
|
|
||||||
default: 'patch'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- 'major'
|
|
||||||
- 'minor'
|
|
||||||
- 'patch'
|
|
||||||
github_release:
|
|
||||||
description: 'Create Gitea Release'
|
|
||||||
default: true
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -23,52 +12,56 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout the code
|
- name: Checkout the code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Install uv
|
- name: Setup git-chglog
|
||||||
uses: astral-sh/setup-uv@v5
|
run: |
|
||||||
- name: Set up Python
|
CHGLOG_VERSION="0.15.4"
|
||||||
run: uv python install
|
curl -o git-chglog -L "https://github.com/git-chglog/git-chglog/releases/download/${CHGLOG_VERSION}/git-chglog_linux_amd64"
|
||||||
with:
|
chmod +x git-chglog
|
||||||
python-version-file: "pyproject.toml"
|
|
||||||
|
|
||||||
- name: Install the project
|
- name: Generate CHANGELOG.md
|
||||||
run: uv sync --locked --all-extras --dev
|
id: generate
|
||||||
- name: Set Git identity
|
|
||||||
run: |
|
run: |
|
||||||
git config user.name "Gitea CI"
|
rm -f CHANGELOG.md
|
||||||
git config user.email "ci@git.theprivateserver.de"
|
./git-chglog -o CHANGELOG.md
|
||||||
- name: Bump version
|
if git diff --quiet CHANGELOG.md; then
|
||||||
id: bump
|
echo "changes=false" >> $GITHUB_OUTPUT
|
||||||
run: |
|
else
|
||||||
uv tool install bump-my-version
|
echo "changes=true" >> $GITHUB_OUTPUT
|
||||||
echo "OLD_VERSION<<EOF" >> $GITHUB_ENV
|
fi
|
||||||
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: conventional Changelog Action
|
|
||||||
id: changelog
|
|
||||||
uses: TriPSs/conventional-changelog-action@v3.7.1
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: echo changelog data
|
|
||||||
run: |
|
|
||||||
echo "${{ steps.changelog.outputs.clean_changelog }}"
|
|
||||||
echo "§{ steps.changelog.outputs.tag }}"
|
|
||||||
- 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.clean_changelog }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
make_latest: true
|
|
||||||
env:
|
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 }}
|
||||||
Reference in New Issue
Block a user