Skip to content

Commit

Permalink
Release script to make releases
Browse files Browse the repository at this point in the history
  • Loading branch information
onimitch committed Jan 10, 2024
1 parent f71460b commit c21011f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
release.sh export-ignore
.gitattributes export-ignore
.gitmodules export-ignore
.gitignore export-ignore
2 changes: 1 addition & 1 deletion HXUI/HXUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
32 changes: 32 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

if [ -z "$1" ]; then
echo "Please specify an archive name."
echo "Usage: ./release.sh <archive name> <version>"
exit 1
fi
if [ -z "$2" ]; then
echo "Please specify a version number."
echo "Usage: ./release.sh <archive name> <version>"
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"

0 comments on commit c21011f

Please sign in to comment.