Skip to content

Commit e159a9d

Browse files
committed
fixing changelog workflow
1 parent 8539bb7 commit e159a9d

File tree

3 files changed

+69
-19
lines changed

3 files changed

+69
-19
lines changed
Lines changed: 65 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,100 @@
1-
---
1+
# ---
2+
# name: Automated Version Bump and Changelog
3+
# on:
4+
# push:
5+
# branches: [main]
6+
# paths-ignore: [README.md, docs/**, .github/**]
7+
# permissions:
8+
# contents: write # ✅ allow tag pushes and commits
9+
# jobs:
10+
# bump-version:
11+
# runs-on: ubuntu-latest
12+
# steps:
13+
# - name: Checkout repo
14+
# uses: actions/checkout@v4
15+
# with:
16+
# fetch-depth: 0 # Needed for tags and full history
17+
# - name: Set up Python
18+
# uses: actions/setup-python@v5
19+
# with:
20+
# python-version: '3.13'
21+
# - name: Install tools
22+
# run: |
23+
# pip install bump-my-version
24+
# sudo apt-get update
25+
# sudo apt-get install -y git
26+
# - name: Configure Git
27+
# run: |
28+
# git config user.name "github-actions[bot]"
29+
# git config user.email "github-actions[bot]@users.noreply.github.com"
30+
# git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
31+
# - name: Ensure initial tag exists
32+
# run: |
33+
# if ! git describe --tags --abbrev=0 >/dev/null 2>&1; then
34+
# git tag v0.0.0
35+
# git push --tags
36+
# fi
37+
# - name: Get latest tag
38+
# id: latest_tag
39+
# run: |
40+
# echo "tag=$(git describe --tags --abbrev=0 || echo 'v0.0.0')" >> $GITHUB_OUTPUT
41+
# - name: Generate changelog
42+
# run: |
43+
# echo "## Changelog" > CHANGELOG.md
44+
# echo "" >> CHANGELOG.md
45+
# git log ${{ steps.latest_tag.outputs.tag }}..HEAD --pretty=format:"- %s (%an)" >> CHANGELOG.md
46+
# - name: Bump patch version
47+
# run: |-
48+
# bump-my-version bump patch --verbose
49+
# git add CHANGELOG.md
50+
# git commit -m "bump: patch version + changelog [skip ci]" || echo "No changes to commit"
51+
# git push
52+
# git push --tags
253
name: Automated Version Bump and Changelog
54+
355
on:
456
push:
557
branches: [main]
658
paths-ignore: [README.md, docs/**, .github/**]
59+
760
permissions:
8-
contents: write # ✅ allow tag pushes and commits
61+
contents: write
62+
963
jobs:
1064
bump-version:
1165
runs-on: ubuntu-latest
1266
steps:
1367
- name: Checkout repo
1468
uses: actions/checkout@v4
1569
with:
16-
fetch-depth: 0 # Needed for tags and full history
70+
fetch-depth: 0
71+
1772
- name: Set up Python
1873
uses: actions/setup-python@v5
1974
with:
2075
python-version: '3.13'
21-
- name: Install tools
76+
77+
- name: Install bump-my-version
2278
run: |
2379
pip install bump-my-version
24-
sudo apt-get update
25-
sudo apt-get install -y git
80+
2681
- name: Configure Git
2782
run: |
2883
git config user.name "github-actions[bot]"
2984
git config user.email "github-actions[bot]@users.noreply.github.com"
3085
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
86+
3187
- name: Ensure initial tag exists
3288
run: |
3389
if ! git describe --tags --abbrev=0 >/dev/null 2>&1; then
3490
git tag v0.0.0
3591
git push --tags
3692
fi
37-
- name: Get latest tag
38-
id: latest_tag
93+
94+
- name: Bump patch version and update changelog
3995
run: |
40-
echo "tag=$(git describe --tags --abbrev=0 || echo 'v0.0.0')" >> $GITHUB_OUTPUT
41-
- name: Generate changelog
42-
run: |
43-
echo "## Changelog" > CHANGELOG.md
44-
echo "" >> CHANGELOG.md
45-
git log ${{ steps.latest_tag.outputs.tag }}..HEAD --pretty=format:"- %s (%an)" >> CHANGELOG.md
46-
- name: Bump patch version
47-
run: |-
4896
bump-my-version bump patch --verbose
49-
git add CHANGELOG.md
97+
git add pyproject.toml CHANGELOG.md
5098
git commit -m "bump: patch version + changelog [skip ci]" || echo "No changes to commit"
5199
git push
52100
git push --tags

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
## [Unreleased]
44

5+
## [0.1.31] - 2025-04-29
6+
57
- (Placeholder for new changes)
68

79
## [0.1.30] - 2025-04-27
810

911
- Merge branch 'main' of https://github.com/finsite/template_python (Mark Quinn)
1012
- Added pylintrc (Mark Quinn)
11-
- bump: patch version + changelog [skip ci] (github-actions[bot])
13+
- bump: patch version + changelog [skip ci] (github-actions[bot])

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ version = "0.1.0"
111111
tag_format = "v$version"
112112

113113
[tool.bumpversion]
114-
current_version = "0.1.30"
114+
current_version = "0.1.31"
115115
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
116116
serialize = ["{major}.{minor}.{patch}"]
117117
search = "{current_version}"

0 commit comments

Comments
 (0)