diff options
| author | hathach <[email protected]> | 2025-02-12 11:28:16 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-02-12 11:28:16 +0700 |
| commit | 87adc63226a59e6c2602b1bc453ced77d44fedba (patch) | |
| tree | 1e47a80bfab09dbac47312b4242939df03ec7796 /tools/make_release.py | |
| parent | b41f5eadb3143d0bfaf211d9bc84c95e5d623c29 (diff) | |
| parent | 5afcfb7522c4fd8b50512cfb277d8a3ccdbc5453 (diff) | |
Merge branch 'master' into fork/atoktoto/midihost
# Conflicts:
# hw/bsp/rp2040/family.cmake
# src/class/midi/midi.h
# src/class/midi/midi_device.c
# src/device/usbd_control.c
# src/host/hcd.h
# src/host/usbh.c
# src/host/usbh.h
Diffstat (limited to 'tools/make_release.py')
| -rwxr-xr-x | tools/make_release.py | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tools/make_release.py b/tools/make_release.py new file mode 100755 index 000000000..c1caf3300 --- /dev/null +++ b/tools/make_release.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +import re +import gen_doc + +version = '0.18.0' + +print('version {}'.format(version)) +ver_id = version.split('.') + +################### +# src/tusb_option.h +################### +f_option_h = 'src/tusb_option.h' +with open(f_option_h) as f: + fdata = f.read() + fdata = re.sub(r'(#define TUSB_VERSION_MAJOR *) \d+', r"\1 {}".format(ver_id[0]), fdata) + fdata = re.sub(r'(#define TUSB_VERSION_MINOR *) \d+', r"\1 {}".format(ver_id[1]), fdata) + fdata = re.sub(r'(#define TUSB_VERSION_REVISION *) \d+', r"\1 {}".format(ver_id[2]), fdata) + +# Write the file out again +with open(f_option_h, 'w') as f: + f.write(fdata) + +################### +# repository.yml +################### +f_repository_yml = 'repository.yml' +with open(f_repository_yml) as f: + fdata = f.read() + +if fdata.find(version) < 0: + fdata = re.sub(r'("0-latest"): "\d+\.\d+\.\d+"', r'"{}": "{}"\r\n \1: "{}"'.format(version, version, version), fdata) + with open(f_repository_yml, 'w') as f: + f.write(fdata) + +################### +# library.json +################### +f_library_json = 'library.json' +with open(f_library_json) as f: + fdata = f.read() + fdata = re.sub(r'( {4}"version":) "\d+\.\d+\.\d+"', rf'\1 "{version}"', fdata) + +with open(f_library_json, 'w') as f: + f.write(fdata) + +################### +# docs/info/changelog.rst +################### + +gen_doc.gen_deps_doc() + +print("Update docs/info/changelog.rst") |
