Last active
May 14, 2019 03:41
-
-
Save fusion809/c73856cfc60aab54f5c63e6b2a8063e0 to your computer and use it in GitHub Desktop.
AppImage builder for OpenRA, with OpenRA/OpenRA#16516 applied and the AppImage name reflecting its commit number and hash.
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
#!/bin/bash | |
latest_commit_on_branch () { | |
git log | head -n 1 | cut -d ' ' -f 2 | |
} | |
current_git_branch () { | |
git rev-parse --abbrev-ref HEAD | |
} | |
update_git_repo () { | |
git pull origin $(current_git_branch) -q | |
} | |
latest_commit_number () { | |
update_git_repo | |
git rev-list --branches "$(current_git_branch)" --count | |
} | |
# Remove old AppImages | |
rm ~/Applications/OpenRA/OpenRA-{Red-Alert,Dune-2000,Tiberian-Dawn}-*-x86_64.AppImage | |
# Change to my local copy of the OpenRA repo that's not used by the i3bar update checker scripts | |
cd ~/GitHub/others/OpenRA.copy20190510 | |
# Stash any past changes | |
git stash | |
# Update repo to the latest commit upstream | |
git fetch origin | |
git rebase origin | |
# Apply patch | |
patch -Np1 -i 16516.patch | |
# Clean up from any past runs of the 'make' command | |
make clean | |
# Build engine and mods | |
make | |
# Build AppImage | |
cd packaging/linux | |
./buildpackage.sh $(latest_commit_number).git.$(latest_commit_on_branch | head -c 7) ~/Applications/OpenRA | |
# Rename AppImages to a name reflecting the commit number and hash | |
for i in "Red Alert" "Dune 2000" "Tiberian Dawn" | |
do | |
mv ~/Applications/OpenRA/OpenRA-${i/ /-}-devel-x86_64.AppImage ~/Applications/OpenRA/OpenRA-${i/ /-}-$(latest_commit_number).git.$(latest_commit_on_branch | head -c 7)-x86_64.AppImage | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment