From 407953f53e4cc2251691cce55a85c4b6d7bdbc0b Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Wed, 23 Nov 2022 09:15:52 +0100 Subject: [PATCH] make the build version dependent on commit revision number (first 7 characters) --- tools/build.sh | 2 +- tools/update_version.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 tools/update_version.py diff --git a/tools/build.sh b/tools/build.sh index 91e16a5..0090b8e 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -5,4 +5,4 @@ else wget https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/$BUILDER fi chmod +x appimage-builder-1.1.0-x86_64.AppImage -./appimage-builder-1.1.0-x86_64.AppImage --skip-tests +./appimage-builder-1.1.0-x86_64.AppImage --skip-tests --recipe AppImageBuilder${GO_PIPELINE_LABEL:-}.yml diff --git a/tools/update_version.py b/tools/update_version.py new file mode 100755 index 0000000..8639edd --- /dev/null +++ b/tools/update_version.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +import os +import yaml + +if __name__ == "__main__": + if "GO_PIPELINE_LABEL" in os.environ: + version = os.environ["GO_PIPELINE_LABEL"] + appimage_yaml = yaml.safe_load(open("AppImageBuilder.yml")) + appimage_yaml["AppDir"]["app_info"]["version"] = version + with open(f"AppImageBuilder{version}.yml","wb") as yaml_file: + yaml.safe_dump(appimage_yaml, yaml_file, encoding = 'utf-8') + else: + print("No GO_PIPELINE_LABEL found, doing nothing") +