File tree Expand file tree Collapse file tree 5 files changed +58
-67
lines changed Expand file tree Collapse file tree 5 files changed +58
-67
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"template" : " https://github.com/viseshrp/yapc" ,
3
- "commit" : " 7e735f29908dbe256f42fe788aa5ad31e905e4cf " ,
3
+ "commit" : " b123cc504566db88232428f02c8c72f913433f9b " ,
4
4
"checkout" : null ,
5
5
"context" : {
6
6
"cookiecutter" : {
16
16
"git_init" : " n" ,
17
17
"github_actions" : " y" ,
18
18
"_template" : " https://github.com/viseshrp/yapc" ,
19
- "_commit" : " 7e735f29908dbe256f42fe788aa5ad31e905e4cf "
19
+ "_commit" : " b123cc504566db88232428f02c8c72f913433f9b "
20
20
}
21
21
},
22
22
"directory" : null
Original file line number Diff line number Diff line change @@ -5,11 +5,7 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/ ) ,
6
6
and this project adheres to [ Semantic Versioning] ( https://semver.org/ ) .
7
7
8
- ## [ 0.5.0] - <Unreleased >
9
-
10
- ### Added
11
-
12
- - TODO: Add ability to add/update packages in pyproject.toml files.
8
+ ## [ 0.4.3] - 2025-06-11
13
9
14
10
### Changed
15
11
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ """
3
+ Check release date for a given version in CHANGELOG.md.
4
+ """
5
+
6
+ from datetime import date
7
+ from pathlib import Path
8
+ import sys
9
+
10
+ CHANGELOG_PATH = Path ("CHANGELOG.md" )
11
+
12
+
13
+ def main (version : str ) -> None :
14
+ if not CHANGELOG_PATH .exists ():
15
+ print (f"❌ ERROR: { CHANGELOG_PATH } does not exist." )
16
+ sys .exit (1 )
17
+
18
+ today = date .today ().isoformat ()
19
+ target_line = f"## [{ version } ] - { today } "
20
+
21
+ found = False
22
+ lines = CHANGELOG_PATH .read_text (encoding = "utf-8" ).splitlines ()
23
+
24
+ for i , line in enumerate (lines ):
25
+ if line .strip () == target_line :
26
+ print (f"🔍 Found line { i + 1 } : { target_line } " )
27
+ found = True
28
+ break
29
+
30
+ if not found :
31
+ print ("❌ ERROR: CHANGELOG.md is not ready for release." )
32
+ print (f" Expected line: { target_line } " )
33
+ print ("Tip: Check if it's still marked as '[Unreleased]' and update it to today's date." )
34
+ sys .exit (1 )
35
+
36
+
37
+ if __name__ == "__main__" :
38
+ if len (sys .argv ) != 2 :
39
+ print ("Usage: uv run python scripts/check_changelog_date.py <version>" )
40
+ sys .exit (1 )
41
+
42
+ main (sys .argv [1 ])
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
-
3
2
set -euo pipefail
4
3
5
4
VERSION=$( hatch version | sed ' s/\.dev.*//' )
6
5
echo " 🏷 Releasing version: $VERSION "
7
6
8
7
# Update changelog date for this version
9
- uv run python scripts/fix_changelog_date.py " $VERSION "
8
+ uv run python scripts/check_changelog_date.py " $VERSION "
9
+
10
+ # Assert we're on main and clean
11
+ branch=$( git rev-parse --abbrev-ref HEAD)
12
+ if [[ " $branch " != " main" ]]; then
13
+ echo " ❌ ERROR: Must be on main branch to tag a release."
14
+ exit 1
15
+ fi
10
16
11
- # Only commit if the changelog was actually updated
12
- if ! git diff --quiet --exit-code CHANGELOG.md; then
13
- echo " ✅ CHANGELOG.md updated, committing..."
14
- git add CHANGELOG.md
15
- git commit -m " 📄 Update changelog for v$VERSION "
16
- else
17
- echo " ℹ️ No changes to CHANGELOG.md. Skipping commit."
17
+ if ! git diff --quiet HEAD; then
18
+ echo " ❌ ERROR: Working directory is dirty. Commit your changes through a PR."
19
+ exit 1
18
20
fi
19
21
20
- # Always tag and push (tagging the latest HEAD whether or not changelog changed)
22
+ # Create and push tag only
21
23
git tag " v$VERSION " -m " Release v$VERSION "
22
24
git push origin " v$VERSION "
25
+ echo " ✅ Tag v$VERSION pushed successfully."
You can’t perform that action at this time.
0 commit comments