mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
Merge remote-tracking branch 'fork/main' into feat/messenger-groups-receipts
This commit is contained in:
+28
-48
@@ -72,61 +72,41 @@ jobs:
|
|||||||
VAR_REPO: ${{ vars.RENDERER_REPO }}
|
VAR_REPO: ${{ vars.RENDERER_REPO }}
|
||||||
VAR_REF: ${{ vars.RENDERER_REF }}
|
VAR_REF: ${{ vars.RENDERER_REF }}
|
||||||
run: |
|
run: |
|
||||||
REPO="${{ github.event.inputs.renderer_repo }}"
|
# Branch-aware auto pairing — the default when neither a
|
||||||
REF="${{ github.event.inputs.renderer_ref }}"
|
# dispatch input nor a repo variable is supplied.
|
||||||
|
#
|
||||||
|
# Everything (including the custom features — rare values,
|
||||||
|
# fortune wheel, soundboard) now lives on duckietm's own
|
||||||
|
# `main` / `Dev` branches, so the renderer always pairs
|
||||||
|
# against UPSTREAM_RENDERER_REPO: `main` when the client build
|
||||||
|
# context is `main`, otherwise `Dev`. For PRs the context is
|
||||||
|
# the base ref.
|
||||||
|
case "${GITHUB_EVENT_NAME}" in
|
||||||
|
pull_request)
|
||||||
|
CTX="${GITHUB_BASE_REF}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
CTX="${GITHUB_REF_NAME}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if [ -z "$REPO" ] || [ -z "$REF" ]; then
|
AUTO_REPO="${UPSTREAM_RENDERER_REPO}"
|
||||||
# For PRs we usually pair against the base ref, but the HK
|
case "$CTX" in
|
||||||
# PR specifically needs to pair against its OWN head ref —
|
main) AUTO_REF="main" ;;
|
||||||
# the renderer companion PR is named identically
|
*) AUTO_REF="Dev" ;;
|
||||||
# (`feat/housekeeping-packets`) and lives on the same fork.
|
esac
|
||||||
case "${GITHUB_EVENT_NAME}" in
|
|
||||||
pull_request)
|
|
||||||
if [ "${GITHUB_HEAD_REF}" = "feat/housekeeping-panel" ]; then
|
|
||||||
CTX="${GITHUB_HEAD_REF}"
|
|
||||||
else
|
|
||||||
CTX="${GITHUB_BASE_REF}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
CTX="${GITHUB_REF_NAME}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "$CTX" in
|
# Precedence (most specific wins): dispatch input → repo
|
||||||
main)
|
# variable → branch-aware auto default. The auto default is
|
||||||
AUTO_REPO="duckietm/Nitro_Render_V3"
|
# the final fallback so a Dev/feat build never silently pairs
|
||||||
AUTO_REF="main"
|
# against a renderer that's missing its companion exports.
|
||||||
;;
|
|
||||||
Dev)
|
|
||||||
# The client `Dev` branch carries the custom features
|
|
||||||
# (rare values, fortune wheel, soundboard); they live on
|
|
||||||
# the matching renderer fork branch, not upstream.
|
|
||||||
AUTO_REPO="medievalshell/Nitro_Render_V3"
|
|
||||||
AUTO_REF="dev"
|
|
||||||
;;
|
|
||||||
feat/housekeeping-panel)
|
|
||||||
AUTO_REPO="simoleo89/Nitro_Render_V3"
|
|
||||||
AUTO_REF="feat/housekeeping-packets"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
AUTO_REPO="duckietm/Nitro_Render_V3"
|
|
||||||
AUTO_REF="Dev"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ -z "$REPO" ] && REPO="$AUTO_REPO"
|
|
||||||
[ -z "$REF" ] && REF="$AUTO_REF"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Precedence: dispatch input → repo variable → upstream default.
|
|
||||||
REPO="$IN_REPO"
|
REPO="$IN_REPO"
|
||||||
[ -z "$REPO" ] && REPO="$VAR_REPO"
|
[ -z "$REPO" ] && REPO="$VAR_REPO"
|
||||||
[ -z "$REPO" ] && REPO="$UPSTREAM_RENDERER_REPO"
|
[ -z "$REPO" ] && REPO="$AUTO_REPO"
|
||||||
|
|
||||||
REF="$IN_REF"
|
REF="$IN_REF"
|
||||||
[ -z "$REF" ] && REF="$VAR_REF"
|
[ -z "$REF" ] && REF="$VAR_REF"
|
||||||
[ -z "$REF" ] && REF="$DEFAULT_REF"
|
[ -z "$REF" ] && REF="$AUTO_REF"
|
||||||
|
|
||||||
echo "repo=$REPO" >> "$GITHUB_OUTPUT"
|
echo "repo=$REPO" >> "$GITHUB_OUTPUT"
|
||||||
echo "ref=$REF" >> "$GITHUB_OUTPUT"
|
echo "ref=$REF" >> "$GITHUB_OUTPUT"
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
name: Safe Sync - Nitro-V3
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# GitHub non offre trigger cross-repo: non possiamo "ascoltare" i push
|
||||||
|
# sull'upstream senza esserne collaboratori. Per avvicinarci a un
|
||||||
|
# "automatico quando cambia" facciamo polling frequente: ogni run fa
|
||||||
|
# fetch dell'upstream e lavora SOLO sui branch effettivamente avanzati
|
||||||
|
# (guard "skip se invariato" sotto). Alza/abbassa la frequenza qui.
|
||||||
|
# NB: i cron possono partire con qualche minuto di ritardo e GitHub li
|
||||||
|
# disabilita dopo 60 giorni di inattività del repo.
|
||||||
|
- cron: '*/30 * * * *' # ogni 30 minuti
|
||||||
|
workflow_dispatch: # avvio manuale dalla scheda Actions
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: safe-sync
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync-safe:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Fork
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Configure Git Credentials
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
- name: Fetch and Merge Upstream
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
git remote add upstream https://github.com/duckietm/Nitro-V3.git 2>/dev/null || \
|
||||||
|
git remote set-url upstream https://github.com/duckietm/Nitro-V3.git
|
||||||
|
git fetch upstream --prune
|
||||||
|
|
||||||
|
for branch in $(git branch -r | grep 'upstream/' | grep -v 'HEAD'); do
|
||||||
|
local_branch=${branch#upstream/}
|
||||||
|
echo "::group::$local_branch"
|
||||||
|
|
||||||
|
git checkout "$local_branch" 2>/dev/null || \
|
||||||
|
git checkout -b "$local_branch" "upstream/$local_branch"
|
||||||
|
|
||||||
|
upstream_sha=$(git rev-parse "upstream/$local_branch")
|
||||||
|
if git merge-base --is-ancestor "$upstream_sha" HEAD; then
|
||||||
|
echo "Nessun cambiamento per $local_branch, salto."
|
||||||
|
echo "::endgroup::"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Novità rilevate su $local_branch, provo il merge..."
|
||||||
|
if git merge "upstream/$local_branch" --no-edit; then
|
||||||
|
echo "Merge ok per $local_branch. Invio gli aggiornamenti..."
|
||||||
|
git push origin "$local_branch"
|
||||||
|
else
|
||||||
|
echo "Conflitto di merge su $local_branch! Il tuo lavoro è al sicuro: salto il push e annullo il merge."
|
||||||
|
git merge --abort
|
||||||
|
fi
|
||||||
|
echo "::endgroup::"
|
||||||
|
done
|
||||||
@@ -186,7 +186,7 @@ export const MainView: FC<{}> = props =>
|
|||||||
<RareValuesView />
|
<RareValuesView />
|
||||||
<FortuneWheelView />
|
<FortuneWheelView />
|
||||||
<SoundboardView />
|
<SoundboardView />
|
||||||
{ GetConfigurationValue<boolean>('radio_ui.enabled', false) && <RadioView /> }
|
<RadioView />
|
||||||
<ExternalPluginLoader />
|
<ExternalPluginLoader />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user