From 407953f53e4cc2251691cce55a85c4b6d7bdbc0b Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Wed, 23 Nov 2022 09:15:52 +0100 Subject: [PATCH 1/4] 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") + From f44eb3b58d32f2366dd728ae6afd20abffc7f9e4 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Wed, 23 Nov 2022 09:30:29 +0100 Subject: [PATCH 2/4] added output to tool/update_version.py --- tools/update_version.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/update_version.py b/tools/update_version.py index 8639edd..c7a9041 100755 --- a/tools/update_version.py +++ b/tools/update_version.py @@ -9,6 +9,7 @@ if __name__ == "__main__": 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') + print(f"New AppImageBuilder file written: {yaml_file.name}") else: print("No GO_PIPELINE_LABEL found, doing nothing") From e35287e02502057f59dcbe5cf578718970c8577a Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Wed, 23 Nov 2022 09:40:31 +0100 Subject: [PATCH 3/4] fixed versions in upload script --- tools/upload_appimage.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/upload_appimage.py b/tools/upload_appimage.py index 31a8b07..03fe695 100755 --- a/tools/upload_appimage.py +++ b/tools/upload_appimage.py @@ -83,10 +83,11 @@ if __name__ == "__main__": secret = os.environ["s3_secret"] host = "mirror.infra.pkm:9000" bucket = "nmreval-appimage" - appimage_version = yaml.safe_load(open("AppImageBuilder.yml"))["AppDir"]["app_info"]["version"] - filenames = [f"NMReval-{appimage_version}-x86_64.AppImage", - f"NMReval-{appimage_version}-x86_64.AppImage.zsync", - ] + if "GO_PIPELINE_LABEL" in os.environ: + appimage_version = os.environ["GO_PIPELINE_LABEL"] + else: + appimage_version = yaml.safe_load(open("AppImageBuilder.yml"))["AppDir"]["app_info"]["version"] + print(f"Uploading NMReval-{appimage_version}-x86_64.AppImage and .zsync") upload(key, secret, host, bucket, f"NMReval-{appimage_version}-x86_64.AppImage") upload(key, secret, host, bucket, From bcccb95466adfacabab58f17a30cc791f329438a Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Wed, 23 Nov 2022 12:36:09 +0100 Subject: [PATCH 4/4] added aptly signing key --- AppImageBuilder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml index 014d4d1..da1650f 100644 --- a/AppImageBuilder.yml +++ b/AppImageBuilder.yml @@ -81,5 +81,5 @@ AppDir: AppImage: update-information: 'zsync|http://mirror.infra.pkm/nmreval/NMReval-latest-x86_64.AppImage.zsync' - sign-key: None + sign-key: 976AC9D78688B628B00D4944D319B98C2D6CE5D3 arch: x86_64