From 441085e23ca728ed7de51b93725f757e732301b6 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Tue, 5 Nov 2024 12:23:47 +0900 Subject: [PATCH] Expanding the automation_tools/install_dependencies.sh inside the pipeline itself as it cannot be outsourced --- .github/workflows/install_dependencies.yml | 35 +++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/install_dependencies.yml b/.github/workflows/install_dependencies.yml index 17ff0f6..781db99 100644 --- a/.github/workflows/install_dependencies.yml +++ b/.github/workflows/install_dependencies.yml @@ -11,4 +11,37 @@ jobs: - name: "Install dependencies" run: | echo "Starting dependency installation..." - /bin/bash "${GITHUB_WORKSPACE}/automation_tools/install_dependencies.sh" \ No newline at end of file + + # NOTE: this script is a copy and paste of automation_tools/install_dependencies.sh + # Please keep the original updated + + unset pkg_mgr + + # rpm-ostree must be checked before dnf because a dnf (wrapper) command also works on rpm-ostree distros (not what we want) + for potential_pkg_mgr in apt pacman rpm-ostree dnf; do + command -v "$potential_pkg_mgr" &> /dev/null && pkg_mgr="$potential_pkg_mgr" && break + done + + case "$pkg_mgr" in + apt) + sudo add-apt-repository -y ppa:flatpak/stable + sudo apt update + sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet bzip2 curl jq + ;; + pacman) + sudo pacman -Syu --noconfirm flatpak flatpak-builder p7zip xmlstarlet bzip2 + ;; + rpm-ostree) + echo "When using a distro with rpm-ostree, you shouldn't build directly on the host. Try using a distrobox." + exit 1 + ;; + dnf) + sudo dnf install -y flatpak flatpak-builder p7zip p7zip-plugins xmlstarlet bzip2 curl + ;; + *) + echo "Package manager $pkg_mgr not supported. Please open an issue." + ;; + esac + + flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak remote-add --user --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo \ No newline at end of file