mirror of
https://github.com/Dasemu/NavFrame.git
synced 2026-11-26 15:26:05 +00:00
release: promote development as 0.14.6 and automate version bumps
The development -> main promotion must carry x.(y+1).z relative to main (0.13.6 -> 0.14.6), but development still declared 0.13.7, so the branch and version policy check failed. Set versionName 0.14.6 (versionCode 23 > main's 22) and the README version. Add a --write mode to the policy script that applies the exact required versionName, versionCode and README version for any allowed source/destination pair, and make a failed check print that command, so bumps are never computed by hand again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FdDjmR7v3NW8B5F37mxZWE
This commit is contained in:
5 files changed
+94
-20
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import unittest
|
||||
from scripts.check_version_policy import validate
|
||||
from scripts.check_version_policy import apply_version, parse_version, validate
|
||||
|
||||
|
||||
class VersionPolicyTest(unittest.TestCase):
|
||||
@@ -30,6 +30,19 @@ class VersionPolicyTest(unittest.TestCase):
|
||||
with self.assertRaises(ValueError):
|
||||
validate('main', 'feat/major', (0, 13, 4), (1, 13, 4), 20, 21, True)
|
||||
|
||||
def test_promotion_keeps_destination_patch(self):
|
||||
validate('main', 'development', (0, 13, 6), (0, 14, 6), 22, 24)
|
||||
with self.assertRaises(ValueError):
|
||||
validate('main', 'development', (0, 13, 6), (0, 13, 7), 22, 23)
|
||||
|
||||
def test_apply_version_rewrites_gradle_and_readme(self):
|
||||
gradle = ' defaultConfig {\n versionName = "0.13.7"\n versionCode = 23\n }\n'
|
||||
readme = 'The current checkout is version 0.13.7. The 0.13 series adds voices.\n'
|
||||
gradle, readme = apply_version(gradle, readme, (0, 14, 6), 24)
|
||||
self.assertEqual(parse_version(gradle), ((0, 14, 6), 24))
|
||||
self.assertIn(' versionCode = 24\n', gradle)
|
||||
self.assertEqual(readme, 'The current checkout is version 0.14.6. The 0.13 series adds voices.\n')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user