forked from dulsi/BYTEPATH
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86dc967
commit 5c91cfc
Showing
4 changed files
with
118 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
BYTEPATH-win32.zip | ||
BYTEPATH.AppImage | ||
BYTEPATH.love | ||
game_64.AppImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/sh -eu | ||
# | ||
# build release binaries for Windows and Linux | ||
|
||
current_love_release='11.4' | ||
|
||
# get the path to the repo | ||
repo_dir="$(realpath "$(dirname "$0")")" | ||
cd "$repo_dir" | ||
|
||
( | ||
# separated by '' (Unit Separator (0x1F) usually rendered as '^_') (Ctrl-v Ctrl-Shift--) | ||
generated_files="BYTEPATH.loveBYTEPATH-win32.zipBYTEPATH.AppImagegame_64.AppImage" | ||
|
||
# set IFS to Unit Separator (GitHub doesn't render control characters) | ||
IFS='' | ||
for file in ${generated_files}; do | ||
if [ -e "$file" ]; then | ||
rm "$file" | ||
fi | ||
done | ||
) | ||
|
||
# some stuff in the repo doesn't need to be included in the release | ||
# zip's --exclude doesn't exclude directories, test case: `zip -sf --recurse-paths test.zip . --exclude tutorial/ release.sh | grep tutorial` | ||
find . \! -path './tutorial*' \! -path './.git*' \! -path './release.sh' \! -path './BYTEPATH.love' \! -path './resources/BYTEPATH.desktop' | zip -9 --names-stdin BYTEPATH.love | ||
|
||
tmp_dir="$(mktemp -d)" | ||
cd "$tmp_dir" | ||
|
||
# create a Windows executable | ||
curl --disable --location --output 'love-win32.zip' \ | ||
"https://github.com/love2d/love/releases/download/${current_love_release}/love-${current_love_release}-win32.zip" | ||
|
||
mkdir love-win32 | ||
unzip love-win32.zip -d love-win32 | ||
love_dir_name="$(basename love-win32/* )" | ||
|
||
cd "love-win32/$love_dir_name" | ||
|
||
rm 'readme.txt' | ||
cat "love.exe" "${repo_dir}/BYTEPATH.love" > "BYTEPATH.exe" | ||
|
||
cd .. | ||
|
||
mv "$love_dir_name" 'BYTEPATH' | ||
zip -9 --recurse-paths 'BYTEPATH-win32.zip' 'BYTEPATH' | ||
mv 'BYTEPATH-win32.zip' "$repo_dir" | ||
|
||
cd "$tmp_dir" | ||
|
||
# create a Linux appimage | ||
mkdir love-lin64 | ||
cd love-lin64 | ||
|
||
curl --disable --location --output 'love-x86_64.AppImage' \ | ||
"https://github.com/love2d/love/releases/download/${current_love_release}/love-${current_love_release}-x86_64.AppImage" | ||
curl --disable --location --remote-name 'https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage' | ||
|
||
chmod +x 'love-x86_64.AppImage' 'appimagetool-x86_64.AppImage' | ||
./love-x86_64.AppImage --appimage-extract | ||
|
||
cat 'squashfs-root/bin/love' "${repo_dir}/BYTEPATH.love" > 'squashfs-root/bin/BYTEPATH' | ||
chmod +x 'squashfs-root/bin/BYTEPATH' | ||
|
||
rm 'squashfs-root/love.desktop' | ||
cp "${repo_dir}/resources/BYTEPATH.desktop" 'squashfs-root/' | ||
|
||
./appimagetool-x86_64.AppImage 'squashfs-root' 'BYTEPATH.AppImage' | ||
|
||
mv 'BYTEPATH.AppImage' "$repo_dir" | ||
|
||
cd "$repo_dir" | ||
rm -r "$tmp_dir" | ||
cp 'BYTEPATH.AppImage' 'game_64.AppImage' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Desktop Entry] | ||
Name=BYTEPATH | ||
Exec=BYTEPATH | ||
Type=Application | ||
Categories=Game; | ||
Terminal=false | ||
Icon=love |