diff --git a/.gitignore b/.gitignore index 49ccc23..6c8cfa9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /target /assets/ui/.dist +/scripts/builds /scripts/appimage/dist /scripts/appimage/*.AppImage diff --git a/Cargo.lock b/Cargo.lock index b532fd1..d9690e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,7 +31,7 @@ dependencies = [ [[package]] name = "anime-game-core" -version = "0.3.1" +version = "0.3.2" dependencies = [ "bzip2", "curl", diff --git a/README.md b/README.md index 296e570..5dd5db0 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,6 @@ cargo build --release ### Building AppImage -Important to run it from the `scripts/appimage` folder - ``` -cd scripts/appimage -./build_appimage.sh +./scripts/build.sh ``` diff --git a/anime-game-core b/anime-game-core index 4009dc5..7c1279a 160000 --- a/anime-game-core +++ b/anime-game-core @@ -1 +1 @@ -Subproject commit 4009dc5bfe93d4b56437bda4f484affe9c5170f2 +Subproject commit 7c1279a6c3df8ea1eda70064aaa5b7b340aef4ce diff --git a/scripts/appimage/anime-game-launcher.desktop b/scripts/appimage/anime-game-launcher.desktop index e12d1e4..cf6053d 100644 --- a/scripts/appimage/anime-game-launcher.desktop +++ b/scripts/appimage/anime-game-launcher.desktop @@ -1,5 +1,5 @@ [Desktop Entry] -Name=An Anime Game Launcher +Name=An Anime Game Launcher GTK Icon=icon Exec=AppRun Type=Application diff --git a/scripts/appimage/build_appimage.sh b/scripts/appimage/build_appimage.sh index de25940..fa40ad2 100755 --- a/scripts/appimage/build_appimage.sh +++ b/scripts/appimage/build_appimage.sh @@ -1,9 +1,14 @@ #!/bin/bash +cd "$(dirname "$0")" + linuxdeploy="linuxdeploy-x86_64.AppImage" appimagetool="appimagetool-x86_64.AppImage" -version="0.3.1" +icon="../../assets/images/icon.png" +release_bin="../../target/release/anime-game-launcher" + +version=$(awk '/^version = "(.+)"$/{print substr($3, 2, length($3) - 2)}' '../../Cargo.toml') if [ ! -f $linuxdeploy ]; then @@ -30,12 +35,17 @@ fi mkdir dist -cp "../../target/release/anime-game-launcher" "dist/anime-game-launcher" +cp $release_bin "dist/anime-game-launcher" echo "Executing LinuxDeploy..." -./$linuxdeploy --appdir dist -d anime-game-launcher.desktop --custom-apprun run.sh -i icon.png -o appimage +./$linuxdeploy --appdir dist -d anime-game-launcher.desktop --custom-apprun run.sh -i $icon -o appimage echo "Executing AppImageTool..." VERSION=$version ./$appimagetool dist + +rm -rf dist +rm -f An_Anime_Game_Launcher_GTK-x86_64.AppImage + +cp An_Anime_Game_Launcher_GTK-$version-x86_64.AppImage ../builds/an-anime-game-launcher-gtk-$version.AppImage diff --git a/scripts/appimage/icon.png b/scripts/appimage/icon.png deleted file mode 100644 index 6355931..0000000 Binary files a/scripts/appimage/icon.png and /dev/null differ diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..beda80b --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +curr_dir=$(dirname "$0") + +cd $(dirname $curr_dir) + +cargo build --release + +cd $curr_dir + +rm -rf builds +mkdir builds + +cp ../target/release/anime-game-launcher builds/anime-game-launcher + +./appimage/build_appimage.sh