Skip to content

Commit

Permalink
fix build ci
Browse files Browse the repository at this point in the history
  • Loading branch information
phyzical committed Oct 3, 2024
1 parent c555948 commit a6841f5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkg_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,26 @@ rsync -av --progress src/$plugin_name/ "$tmpdir" --exclude .git --exclude tmp --
cd "$tmpdir" || exit

tar_command="tar"
sed_prefix="-i"

if [[ "$(uname)" == "Darwin" ]]; then
tar_command="gtar"
sed_prefix="-i ''"
fi
$tar_command --owner=0 --group=0 -cJf "$filename" .

cd - || exit

if [[ "$(uname)" == "Darwin" ]]; then
md5hash=$(md5 -q "$filename")
else
md5hash=$(md5sum "$filename" | awk '{ print $1 }')
fi

rm -rf "$tmpdir"

sed -i '' 's/<!ENTITY version ".*">/<!ENTITY version "'"$version"'">/' $plugin_name.plg
md5hash=$(md5 -q "$filename")
sed -i '' 's/<!ENTITY md5 ".*">/<!ENTITY md5 "'"$md5hash"'">/' $plugin_name.plg
sed "$sed_prefix" 's/<!ENTITY version ".*">/<!ENTITY version "'"$version"'">/' $plugin_name.plg
sed "$sed_prefix" 's/<!ENTITY md5 ".*">/<!ENTITY md5 "'"$md5hash"'">/' $plugin_name.plg

echo "MD5: $(md5sum "$filename")"
echo "once pushed install via https://raw.githubusercontent.com/phyzical/$plugin_name/main/$plugin_name.plg"
Expand Down

0 comments on commit a6841f5

Please sign in to comment.