From c21011f76b430b6a6b859d0e2f5cb421aa86aa8f Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Mon, 8 Jan 2024 22:27:34 +0000 Subject: [PATCH] Release script to make releases --- .gitattributes | 4 ++++ HXUI/HXUI.lua | 2 +- release.sh | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 release.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ec3917 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +release.sh export-ignore +.gitattributes export-ignore +.gitmodules export-ignore +.gitignore export-ignore \ No newline at end of file diff --git a/HXUI/HXUI.lua b/HXUI/HXUI.lua index 1b33401..b3429ae 100644 --- a/HXUI/HXUI.lua +++ b/HXUI/HXUI.lua @@ -24,7 +24,7 @@ addon.name = 'HXUI'; addon.author = 'Team HXUI (Tirem, Shuu, colorglut, RheaCloud)'; -addon.version = '1.1.1'; +addon.version = '1.1.1-onimitch1'; addon.desc = 'Multiple UI elements with manager'; addon.link = 'https://github.com/tirem/HXUI' diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..64add02 --- /dev/null +++ b/release.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Please specify an archive name." + echo "Usage: ./release.sh " + exit 1 +fi +if [ -z "$2" ]; then + echo "Please specify a version number." + echo "Usage: ./release.sh " + exit 1 +fi + +prefix="$1" +subdir="HXUI" +outfile="$PWD/$1_$2.zip" +temp_dir="$PWD/release_temp" +temp_zip="$PWD/temp.zip" + +rm -rf "$temp_zip" +rm -rf "$temp_dir" +mkdir -p "$temp_dir" + +git archive --format=zip --prefix "$prefix/" HEAD > "$temp_zip" && unzip "$temp_zip" -d "$temp_dir" && rm -rf "$temp_zip" +git submodule foreach --recursive " git archive --format=zip --prefix=\"$prefix/\$sm_path/\" HEAD > \"$temp_zip\" && unzip \"$temp_zip\" -d \"$temp_dir\" && rm -rf \"$temp_zip\" " + +rm -rf "$outfile" +7z a "$outfile" "$temp_dir/$prefix/$subdir" + +# cleanup +rm -rf "$temp_zip" +rm -rf "$temp_dir" \ No newline at end of file