2022-09-21 07:28:53 +00:00
|
|
|
|
|
|
|
name: PUSH-cooker-flathub
|
|
|
|
|
|
|
|
on:
|
|
|
|
# push:
|
|
|
|
# branches:
|
|
|
|
# - cooker*
|
|
|
|
# pull_request:
|
|
|
|
# branches:
|
|
|
|
# - cooker*
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
Pushing_cooker_into_flathub:
|
2022-09-21 07:38:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-09-21 07:28:53 +00:00
|
|
|
steps:
|
|
|
|
- name: Pushing
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
# EDITABLES:
|
|
|
|
rd_branch="cooker"
|
2022-09-21 07:51:31 +00:00
|
|
|
gits_folder="${GITHUB_WORKSPACE}/gits" # without last /
|
2022-09-21 07:28:53 +00:00
|
|
|
|
|
|
|
# NON-EDITABLES
|
|
|
|
branch="$rd_branch-"$(date +%d%m%y.%H%M)
|
|
|
|
|
2022-09-21 07:46:13 +00:00
|
|
|
mkdir -vp $gits_folder
|
2022-09-21 07:28:53 +00:00
|
|
|
cd $gits_folder
|
2022-09-21 07:46:13 +00:00
|
|
|
if [ -d flathub ]; then
|
2022-09-21 07:58:13 +00:00
|
|
|
rm -rf flathub
|
2022-09-21 07:46:13 +00:00
|
|
|
fi
|
2022-09-21 07:28:53 +00:00
|
|
|
git clone --recursive https://github.com/flathub/net.retrodeck.retrodeck.git flathub
|
2022-09-21 07:49:12 +00:00
|
|
|
cd $gits_folder
|
2022-09-21 07:28:53 +00:00
|
|
|
git clone --recursive https://github.com/XargonWan/RetroDECK RetroDECK
|
|
|
|
cd $gits_folder/RetroDECK
|
|
|
|
git checkout $rd_branch
|
|
|
|
git submodule init
|
|
|
|
git submodule update
|
|
|
|
# NOTE: the only linked submodules are: rd-submodules/retroarch
|
|
|
|
# these must be included in the exclusion list as they must be redownloaded
|
|
|
|
#sync -rav --progress --exclude={'res/screenshots/','shared-modules/','rd-submodules/retroarch','.git/','docs','retrodeck-flatpak/','retrodeck-flatpak-cooker/','.flatpak-builder/'} ~/RetroDECK/ ~/flathub/
|
|
|
|
|
|
|
|
cd $gits_folder/flathub
|
|
|
|
git checkout -b $branch
|
|
|
|
git rm -rf *
|
|
|
|
git clean -fxd # restroing git index
|
|
|
|
|
|
|
|
# Copying only a few files as the others are cloned by git in retrodeck.sh
|
|
|
|
cd $gits_folder/RetroDECK
|
|
|
|
cp -rf \
|
|
|
|
'rd-submodules' \
|
|
|
|
'flathub.json' \
|
|
|
|
'LICENSE' \
|
|
|
|
'net.retrodeck.retrodeck.appdata.xml' \
|
|
|
|
'net.retrodeck.retrodeck.desktop' \
|
|
|
|
'net.retrodeck.retrodeck.yml' \
|
|
|
|
'README.md' \
|
|
|
|
$gits_folder/flathub/
|
|
|
|
|
2022-09-21 07:57:04 +00:00
|
|
|
cd $gits_folder/flathub
|
2022-09-21 09:40:26 +00:00
|
|
|
ls -la
|
|
|
|
|
2022-09-21 08:00:35 +00:00
|
|
|
if [ -d .git/modules ]; then
|
|
|
|
rm -rfv .git/modules/*
|
|
|
|
fi
|
2022-09-21 08:11:34 +00:00
|
|
|
|
2022-09-21 07:28:53 +00:00
|
|
|
# Adding the real submodules, please update this every time a submodule is added
|
2022-09-21 08:11:34 +00:00
|
|
|
|
2022-09-21 07:57:04 +00:00
|
|
|
if [ -d shared-modules ]; then
|
2022-09-21 09:48:16 +00:00
|
|
|
git rm -rf --ignore-unmatch shared-modules
|
2022-09-21 08:11:34 +00:00
|
|
|
fi
|
2022-09-21 09:45:43 +00:00
|
|
|
git submodule add https://github.com/flathub/shared-modules.git ./shared-modules
|
2022-09-21 07:28:53 +00:00
|
|
|
|
2022-09-21 09:40:26 +00:00
|
|
|
if [ -d rd-submodules/retroarch ]; then
|
2022-09-21 09:48:16 +00:00
|
|
|
git rm -rf --ignore-unmatch rd-submodules/retroarch
|
2022-09-21 07:57:04 +00:00
|
|
|
fi
|
2022-09-21 09:45:43 +00:00
|
|
|
git submodule add https://github.com/flathub/org.libretro.RetroArch.git ./rd-submodules/retroarch
|
2022-09-21 07:28:53 +00:00
|
|
|
|
|
|
|
# unbinds all submodules
|
|
|
|
git submodule deinit -f .
|
|
|
|
# checkout again
|
|
|
|
git submodule update --init --recursive
|
|
|
|
git add *
|
|
|
|
git commit -m "Updated flathub/net.retrodeck.retrodeck from RetroDECK/$rd_branch"
|
2022-09-21 07:49:12 +00:00
|
|
|
git push origin $branch
|