LOCAL_BUILD: added manifest caching and experimental args for flatpak-builder [skip ci]

This commit is contained in:
XargonWan 2024-12-11 14:53:38 +09:00
parent a51b66ed9d
commit a11e1bbf39
4 changed files with 49 additions and 24 deletions

1
.gitignore vendored
View file

@ -25,6 +25,7 @@ incconfigs/
.github/workflows/cooker-monkeyx.yml .github/workflows/cooker-monkeyx.yml
*.flatpak *.flatpak
*.flatpak.sha *.flatpak.sha
net.retrodeck.retrodeck.cached.yml
# Python # # Python #
########## ##########

View file

@ -15,10 +15,20 @@ fi
mkdir -vp ${GITHUB_WORKSPACE}/retrodeck-repo mkdir -vp ${GITHUB_WORKSPACE}/retrodeck-repo
mkdir -vp ${GITHUB_WORKSPACE}/"$FOLDER" mkdir -vp ${GITHUB_WORKSPACE}/"$FOLDER"
flatpak-builder --user --force-clean \ # Pass the args to Flatpak Builder
FLATPAK_BUILD_EXTRA_ARGS="${@}"
echo "Passing additional args to flatpak builder: $FLATPAK_BUILD_EXTRA_ARGS"
command="flatpak-builder --user --force-clean $FLATPAK_BUILD_EXTRA_ARGS \
--install-deps-from=flathub \ --install-deps-from=flathub \
--install-deps-from=flathub-beta \ --install-deps-from=flathub-beta \
--repo=${GITHUB_WORKSPACE}/retrodeck-repo \ --repo=${GITHUB_WORKSPACE}/retrodeck-repo \
--disable-download \ --disable-download \
"${GITHUB_WORKSPACE}/$FOLDER" \ \"${GITHUB_WORKSPACE}/$FOLDER\" \
net.retrodeck.retrodeck.yml net.retrodeck.retrodeck.yml"
# Echo the command for verification
echo -e "Executing command:\n$command"
# Execute the command
eval $command

View file

@ -189,6 +189,7 @@ handle_thisrepo() {
} }
# Process the task list # Process the task list
if [ "$use_cached" != "y" ]; then
while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]]; do while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]]; do
if [[ ! "$action" == "#"* ]] && [[ -n "$action" ]]; then if [[ ! "$action" == "#"* ]] && [[ -n "$action" ]]; then
case "$action" in case "$action" in
@ -206,4 +207,4 @@ while IFS="^" read -r action placeholder url branch || [[ -n "$action" ]]; do
esac esac
fi fi
done < "$automation_task_list" done < "$automation_task_list"
fi

View file

@ -4,8 +4,7 @@
# Check if script is running with elevated privileges # Check if script is running with elevated privileges
if [ "$EUID" -ne 0 ]; then if [ "$EUID" -ne 0 ]; then
echo "The build might fail without some superuser permissions, please run me with sudo. Continue without sudo? [y/N]" read -rp "The build might fail without some superuser permissions, please run me with sudo. Continue without sudo? [y/N] " continue_without_sudo
read -r continue_without_sudo
if [[ "$continue_without_sudo" != "y" ]]; then if [[ "$continue_without_sudo" != "y" ]]; then
exit 1 exit 1
fi fi
@ -18,9 +17,23 @@ export GITHUB_WORKSPACE="."
# Initialize the Flatpak repo # Initialize the Flatpak repo
ostree init --mode=archive-z2 --repo=${GITHUB_WORKSPACE}/retrodeck-repo ostree init --mode=archive-z2 --repo=${GITHUB_WORKSPACE}/retrodeck-repo
# Backing up original manifest
cp net.retrodeck.retrodeck.appdata.xml net.retrodeck.retrodeck.appdata.xml.bak cp net.retrodeck.retrodeck.appdata.xml net.retrodeck.retrodeck.appdata.xml.bak
cp net.retrodeck.retrodeck.yml net.retrodeck.retrodeck.yml.bak cp net.retrodeck.retrodeck.yml net.retrodeck.retrodeck.yml.bak
if [[ -f "net.retrodeck.retrodeck.cached.yml" ]]; then
read -rp "A cached manifest file with placeholder substitutions already exists. Do you want to use it? [y/N] " use_cached
if [[ "${use_cached,,}" == "y" ]]; then
cp net.retrodeck.retrodeck.cached.yml net.retrodeck.retrodeck.yml
else
use_cached="n"
fi
else
use_cached="n"
fi
export use_cached
automation_tools/install_dependencies.sh automation_tools/install_dependencies.sh
automation_tools/cooker_build_id.sh automation_tools/cooker_build_id.sh
automation_tools/pre_build_automation.sh automation_tools/pre_build_automation.sh
@ -28,7 +41,7 @@ automation_tools/cooker_flatpak_portal_add.sh
# THIS SCRIPT IS BROKEN HENCE DISABLED FTM # THIS SCRIPT IS BROKEN HENCE DISABLED FTM
# automation_tools/appdata_management.sh # automation_tools/appdata_management.sh
automation_tools/flatpak_build_download_only.sh automation_tools/flatpak_build_download_only.sh
automation_tools/flatpak_build_only.sh automation_tools/flatpak_build_only.sh "${@}"
automation_tools/flatpak_build_bundle.sh automation_tools/flatpak_build_bundle.sh
rm -f net.retrodeck.retrodeck.appdata.xml rm -f net.retrodeck.retrodeck.appdata.xml