RetroDECK/.github/workflows/flathub_push_cooker.yml

88 lines
2.8 KiB
YAML
Raw Normal View History

2022-09-21 07:34:28 +00:00
name: PUSH-cooker-flathub
on:
workflow_dispatch:
jobs:
Pushing_cooker_into_flathub:
2022-09-21 07:35:57 +00:00
runs-on: ubuntu-latest
2022-09-21 07:34:28 +00:00
steps:
- name: Pushing
shell: bash
run: |
2022-10-08 13:55:21 +00:00
2022-09-21 07:34:28 +00:00
# EDITABLES:
2022-10-08 13:31:15 +00:00
rd_branch=${GITHUB_REF_NAME}
echo $rd_branch
2022-09-21 07:53:05 +00:00
gits_folder="${GITHUB_WORKSPACE}/gits" # without last /
2022-09-21 07:34:28 +00:00
2022-09-21 07:46:37 +00:00
mkdir -vp $gits_folder
2022-09-21 07:34:28 +00:00
cd $gits_folder
2022-09-21 07:46:37 +00:00
if [ -d flathub ]; then
2022-09-21 07:58:29 +00:00
rm -rf flathub
2022-09-21 07:46:37 +00:00
fi
2022-09-21 07:34:28 +00:00
git clone --recursive https://github.com/flathub/net.retrodeck.retrodeck.git flathub
2022-09-21 07:48:54 +00:00
cd $gits_folder
2022-09-21 07:34:28 +00:00
git clone --recursive https://github.com/XargonWan/RetroDECK RetroDECK
2022-10-08 13:35:44 +00:00
cd $gits_folder/RetroDECK
2022-10-08 13:34:09 +00:00
# NON-EDITABLES
#relname="$rd_branch-"$(date +%d%m%y.%H%M)
relname="cooker-"$(git rev-parse --short HEAD)
2022-09-21 07:34:28 +00:00
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
2022-10-09 16:35:13 +00:00
2022-10-08 12:53:30 +00:00
git checkout -b $relname
2022-10-09 16:35:13 +00:00
2022-09-21 07:34:28 +00:00
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 \
'flathub.json' \
'LICENSE' \
2022-10-08 12:53:30 +00:00
'flathub.yml' \
2022-09-21 07:34:28 +00:00
'README.md' \
$gits_folder/flathub/
2022-09-21 07:56:42 +00:00
cd $gits_folder/flathub
2022-10-08 12:53:30 +00:00
ls -lah
2022-09-21 09:40:33 +00:00
2022-10-08 12:53:30 +00:00
# manipulating manifest
mv flathub.yml net.retrodeck.retrodeck.yml
2022-09-21 08:11:29 +00:00
2022-10-09 09:38:33 +00:00
# Getting latest release name
# version=$(\
# curl -sL \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer ${{ secrets.TRIGGER_BUILD_TOKEN }}" \
# https://api.github.com/repos/XargonWan/RetroDECK-cooker/releases \
# | jq .[0].tag_name \
# | tr -d \" \
# )
sha=$(curl -sL https://artifacts.retrodeck.net/artifacts/RetroDECK-Artifact.sha)
2022-10-08 14:09:15 +00:00
sed -i "s#__SHA__#$sha#g" net.retrodeck.retrodeck.yml
2022-10-08 12:53:30 +00:00
echo -e "Resulting manifest:\n"
cat net.retrodeck.retrodeck.yml
2022-09-21 07:34:28 +00:00
2022-10-09 15:50:59 +00:00
git config --global user.name "${{ secrets.GITNAME }}"
git config --global user.email "${{ secrets.GITMAIL }}"
2022-10-08 13:49:40 +00:00
git add *
2022-10-09 16:35:13 +00:00
git commit -m "Updated flathub/net.retrodeck.retrodeck from RetroDECK/$rd_branch"
2022-10-08 13:49:40 +00:00
2022-10-09 15:45:03 +00:00
git remote -v
2022-10-09 16:29:20 +00:00
git push --force https://${{ secrets.TRIGGER_BUILD_TOKEN }}@github.com/flathub/net.retrodeck.retrodeck.git $relname