(scripts) update release script to include uv

Update release script to automatically upgrade people's version
on uv.lock file
This commit is contained in:
Marie PUPO JEAMMET
2026-06-24 15:35:36 +00:00
committed by Marie
parent 11468d33ef
commit 7a002eda62
2 changed files with 12 additions and 6 deletions
+1
View File
@@ -10,6 +10,7 @@ and this project adheres to
### Added ### Added
- ✨(scripts) update release script to include uv
- ✨(dimail) auto-import mailboxes from enabled domains - ✨(dimail) auto-import mailboxes from enabled domains
### Fixed ### Fixed
+11 -6
View File
@@ -14,7 +14,7 @@ RELEASE_KINDS = {'p': 'patch', 'm': 'minor', 'mj': 'major'}
def update_files(version): def update_files(version):
"""Update all files needed with new release version""" """Update all files needed with new release version"""
# pyproject.toml # pyproject.toml
sys.stdout.write("Update pyproject.toml...\n") sys.stdout.write("Updating pyproject.toml...\n")
path = "src/backend/pyproject.toml" path = "src/backend/pyproject.toml"
with open(path, 'r') as file: with open(path, 'r') as file:
lines = file.readlines() lines = file.readlines()
@@ -24,8 +24,12 @@ def update_files(version):
with open(path, 'w+') as file: with open(path, 'w+') as file:
file.writelines(lines) file.writelines(lines)
# uv lock file
sys.stdout.write("Updating uv lock file...\n")
run_command("uv lock --directory src/backend", shell=True)
# frontend package.json # frontend package.json
sys.stdout.write("Update package.json...\n") sys.stdout.write("Updating package.json...\n")
files_to_modify = [] files_to_modify = []
filename = "package.json" filename = "package.json"
for root, _dir, files in os.walk("src/frontend"): for root, _dir, files in os.walk("src/frontend"):
@@ -40,11 +44,12 @@ def update_files(version):
lines[index] = re.sub(r'"version": \"(.*?)\"', f'"version": "{version}"', line) lines[index] = re.sub(r'"version": \"(.*?)\"', f'"version": "{version}"', line)
with open(path, 'w+') as file: with open(path, 'w+') as file:
file.writelines(lines) file.writelines(lines)
return return
def update_helm_files(path): def update_helm_files(path):
sys.stdout.write("Update helm files...\n") sys.stdout.write("Updating helm files...\n")
with open(path, 'r') as file: with open(path, 'r') as file:
lines = file.readlines() lines = file.readlines()
for index, line in enumerate(lines): for index, line in enumerate(lines):
@@ -57,7 +62,7 @@ def update_helm_files(path):
def update_changelog(path, version): def update_changelog(path, version):
"""Update changelog file with release info """Update changelog file with release info
""" """
sys.stdout.write("Update CHANGELOG...\n") sys.stdout.write("Updating CHANGELOG...\n")
with open(path, 'r') as file: with open(path, 'r') as file:
lines = file.readlines() lines = file.readlines()
for index, line in enumerate(lines): for index, line in enumerate(lines):
@@ -73,9 +78,9 @@ def update_changelog(path, version):
break break
with open(path, 'w+') as file: with open(path, 'w+') as file:
file.writelines(lines) file.writelines(lines)
def deployment_part(version): def deployment_part(version):
""" Update helm file of preprod on deployment repository numerique-gouv/lasuite-deploiement """ Update helm file of preprod on deployment repository numerique-gouv/lasuite-deploiement
""" """