From 18e18fe3f8435ee37a786b428e74643067da1f7e Mon Sep 17 00:00:00 2001 From: ChronicallySerious Date: Sun, 16 Jan 2022 01:00:11 +0530 Subject: [PATCH] Add release.sh script for creating new releases --- release.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 release.sh diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..08e0cee --- /dev/null +++ b/release.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +# This script is used to create releases for this plugin. This is mostly a helper script for the maintainer. + +echo "Enter the new version number (e.g. 1.2.1):" +read version + +echo "Enter the Windows x64 release ZIP URL:" +read windowsZIPURL + +echo "Enter the Linux x64 release ZIP URL:" +read linuxZIPURL + +echo "Enter the MacOS universal release ZIP URL:" +read macZIPURL + +# wget-ing the github.com URL gives a 404, so we use the method proposed here - https://github.com/actions/upload-artifact/issues/51#issuecomment-735989475 +windowsZIPURL=${windowsZIPURL/github.com/nightly.link} +linuxZIPURL=${linuxZIPURL/github.com/nightly.link} +macZIPURL=${macZIPURL/github.com/nightly.link} + +wget -O windows.zip $windowsZIPURL +wget -O linux.zip $linuxZIPURL +wget -O mac.zip $macZIPURL + +unzip windows.zip -d windows/ +unzip linux.zip -d linux/ +unzip mac.zip -d mac/ + +releasePath=godot-git-plugin-v$version +mkdir $releasePath + +cp -r windows/addons/ $releasePath +addonsPath=$releasePath/addons +pluginPath=$addonsPath/godot-git-plugin + +mkdir $pluginPath/linux +mkdir $pluginPath/osx +cp -r linux/addons/godot-git-plugin/linux/ $pluginPath/ +cp -r mac/addons/godot-git-plugin/osx/ $pluginPath/ + +sed -i "s/version=\"[^\"]*\"/version=\"v${version}\"/g" $pluginPath/plugin.cfg +cp LICENSE $pluginPath/LICENSE +cp THIRDPARTY.md $pluginPath/THIRDPARTY.md + +zip -r $releasePath.zip $addonsPath + +rm -rf $releasePath +rm -rf windows +rm -rf linux +rm -rf mac +rm windows.zip +rm linux.zip +rm mac.zip