Skip to content

Commit 9f6dc73

Browse files
committed
add CITATION.cff version update to release workflow:
- Update `.github/workflows/release.yaml` to bump `CITATION.cff` version and date-released automatically - Keep version in `__init__.py` and `CITATION.cff` in sync during releases - Fully automated in CI, no manaul edits needed
1 parent c51c801 commit 9f6dc73

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/release.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,16 @@ jobs:
4848
- name: checkout
4949
uses: actions/checkout@v5.0.0
5050

51-
- name: Change version in repo
52-
run: sed -i "s/__version__ =.*/__version__ = \"${{ github.event.inputs.version }}\"/g" CodeEntropy/__init__.py
51+
- name: Change version in repo and CITATION.cff
52+
run: |
53+
# Update Python package version
54+
sed -i "s/__version__ =.*/__version__ = \"${{ github.event.inputs.version }}\"/g" CodeEntropy/__init__.py
55+
56+
# Update CITATION.cff version and date-released
57+
if [ -f CITATION.cff ]; then
58+
sed -i -E "s/^(version:\s*).*/\1${{ github.event.inputs.version }}/" CITATION.cff
59+
sed -i -E "s/^(date-released:\s*).*/\1'$(date -u +%F)'/" CITATION.cff
60+
fi
5361
5462
- name: send PR
5563
id: pr_id
@@ -61,6 +69,7 @@ jobs:
6169
body: |
6270
Update version
6371
- Update the __init__.py with new release
72+
- Update CITATION.cff version & date-released
6473
- Auto-generated by [CI]
6574
committer: version-updater <vu.bot@users.noreply.github.com>
6675
author: version-updater <vu.bot@users.noreply.github.com>

0 commit comments

Comments
 (0)