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: on:
push: push:

View file

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

View file

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

View file

@ -12,6 +12,12 @@ else
FOLDER=retrodeck-flatpak-cooker FOLDER=retrodeck-flatpak-cooker
fi 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} mkdir -vp "${GITHUB_WORKSPACE}"/{local,retrodeck-flatpak-cooker}
flatpak-builder --user --force-clean \ flatpak-builder --user --force-clean \
@ -21,3 +27,7 @@ flatpak-builder --user --force-clean \
--download-only \ --download-only \
"${GITHUB_WORKSPACE}/${FOLDER}" \ "${GITHUB_WORKSPACE}/${FOLDER}" \
net.retrodeck.retrodeck.yml 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 FOLDER=retrodeck-flatpak-cooker
fi 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}/.local
mkdir -vp ${GITHUB_WORKSPACE}/"$FOLDER" mkdir -vp ${GITHUB_WORKSPACE}/"$FOLDER"
@ -22,3 +28,7 @@ flatpak-builder --user --force-clean \
--disable-download \ --disable-download \
${GITHUB_WORKSPACE}/"$FOLDER" \ ${GITHUB_WORKSPACE}/"$FOLDER" \
net.retrodeck.retrodeck.yml net.retrodeck.retrodeck.yml
if [ $PERSISTENCE==true ]; then
GITHUB_WORKSPACE="$GITHUB_WORKSPACE_BACKUP"
fi