WORKFLOW: making the automated cooker builder persistent

This commit is contained in:
XargonWan 2023-12-20 10:06:21 +01:00
parent 02c4eccc1d
commit 2fcaa063e4
5 changed files with 51 additions and 18 deletions

View file

@ -1,4 +1,7 @@
name: "Build cooker"
name: "Build cooker (persistent)"
env:
PERSISTENCE: true
on:
push:

View file

@ -1,23 +1,23 @@
name: "Build cooker"
on:
push:
branches:
- cooker*
- feat*
paths:
- '.github/workflows/**'
- 'automation_tools/**'
- 'emu-configs/**'
- 'es-configs/**'
- 'functions/**'
- 'rd-submodules/**'
- '*.sh'
- 'net.retrodeck.retrodeck.yml'
- 'net.retrodeck.retrodeck.appdata.xml'
pull_request:
branches:
- cooker*
# push:
# branches:
# - cooker*
# - feat*
# paths:
# - '.github/workflows/**'
# - 'automation_tools/**'
# - 'emu-configs/**'
# - 'es-configs/**'
# - 'functions/**'
# - 'rd-submodules/**'
# - '*.sh'
# - 'net.retrodeck.retrodeck.yml'
# - 'net.retrodeck.retrodeck.appdata.xml'
# pull_request:
# branches:
# - cooker*
workflow_dispatch:

View file

@ -2,8 +2,18 @@
# This is building the bundle RetroDECK.flatpak after the download and build steps are done
if [ $PERSISTENCE==true ]; then
mkdir -p "$HOME/cooker-persistent"
GITHUB_WORKSPACE_BACKUP="$GITHUB_WORKSPACE"
GITHUB_WORKSPACE="$HOME/cooker-persistent"
fi
if [ "${GITHUB_REF##*/}" = "main" ]; then
flatpak build-bundle ${GITHUB_WORKSPACE}/.local RetroDECK.flatpak net.retrodeck.retrodeck
else
flatpak build-bundle ${GITHUB_WORKSPACE}/.local RetroDECK-cooker.flatpak net.retrodeck.retrodeck
fi
if [ $PERSISTENCE==true ]; then
GITHUB_WORKSPACE="$GITHUB_WORKSPACE_BACKUP"
fi

View file

@ -12,6 +12,12 @@ else
FOLDER=retrodeck-flatpak-cooker
fi
if [ $PERSISTENCE==true ]; then
mkdir -p "$HOME/cooker-persistent"
GITHUB_WORKSPACE_BACKUP="$GITHUB_WORKSPACE"
GITHUB_WORKSPACE="$HOME/cooker-persistent"
fi
mkdir -vp "${GITHUB_WORKSPACE}"/{local,retrodeck-flatpak-cooker}
flatpak-builder --user --force-clean \
@ -21,3 +27,7 @@ flatpak-builder --user --force-clean \
--download-only \
"${GITHUB_WORKSPACE}/${FOLDER}" \
net.retrodeck.retrodeck.yml
if [ $PERSISTENCE==true ]; then
GITHUB_WORKSPACE="$GITHUB_WORKSPACE_BACKUP"
fi

View file

@ -12,6 +12,12 @@ else
FOLDER=retrodeck-flatpak-cooker
fi
if [ $PERSISTENCE==true ]; then
mkdir -p "$HOME/cooker-persistent"
GITHUB_WORKSPACE_BACKUP="$GITHUB_WORKSPACE"
GITHUB_WORKSPACE="$HOME/cooker-persistent"
fi
mkdir -vp ${GITHUB_WORKSPACE}/.local
mkdir -vp ${GITHUB_WORKSPACE}/"$FOLDER"
@ -22,3 +28,7 @@ flatpak-builder --user --force-clean \
--disable-download \
${GITHUB_WORKSPACE}/"$FOLDER" \
net.retrodeck.retrodeck.yml
if [ $PERSISTENCE==true ]; then
GITHUB_WORKSPACE="$GITHUB_WORKSPACE_BACKUP"
fi