mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
Refine descriptions and comments in CI workflow
Updated descriptions for workflow_dispatch inputs and improved comments for clarity.
This commit is contained in:
+50
-62
@@ -9,11 +9,11 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
renderer_repo:
|
renderer_repo:
|
||||||
description: 'Renderer repo (owner/name). Empty = auto from client branch.'
|
description: 'Renderer repo (owner/name). Empty = vars.RENDERER_REPO or upstream default.'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
renderer_ref:
|
renderer_ref:
|
||||||
description: 'Renderer git ref. Empty = auto from client branch.'
|
description: 'Renderer git ref. Empty = vars.RENDERER_REF or auto (main on client main, else Dev).'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
|
||||||
@@ -24,6 +24,11 @@ on:
|
|||||||
# it on every run.
|
# it on every run.
|
||||||
env:
|
env:
|
||||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
|
||||||
|
# Upstream renderer used as the fallback when nothing else is
|
||||||
|
# configured. Override per-fork via the RENDERER_REPO / RENDERER_REF
|
||||||
|
# repository variables (Settings → Secrets and variables → Actions →
|
||||||
|
# Variables) or, for one-off runs, via the workflow_dispatch inputs.
|
||||||
|
UPSTREAM_RENDERER_REPO: 'duckietm/Nitro_Render_V3'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
@@ -39,77 +44,60 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: Nitro-V3
|
path: Nitro-V3
|
||||||
|
|
||||||
# Pick the renderer ref dynamically based on the client context.
|
# Resolve the renderer pairing with a clear precedence, from most
|
||||||
|
# specific to most generic — no fork names or feature branches are
|
||||||
|
# hardcoded in this workflow:
|
||||||
|
#
|
||||||
|
# 1. workflow_dispatch inputs (renderer_repo / renderer_ref)
|
||||||
|
# → explicit manual override, wins outright.
|
||||||
|
# 2. repository variables (vars.RENDERER_REPO / vars.RENDERER_REF)
|
||||||
|
# → per-fork config set under Settings → Variables, applies
|
||||||
|
# to push and pull_request runs without editing this file.
|
||||||
|
# 3. upstream default
|
||||||
|
# → UPSTREAM_RENDERER_REPO, ref `main` when the client build
|
||||||
|
# context is `main`, otherwise `Dev`.
|
||||||
|
#
|
||||||
# The two repos must stay wire-aligned (composer/parser
|
# The two repos must stay wire-aligned (composer/parser
|
||||||
# signatures); pairing `main` with a stale branch is what
|
# signatures); pairing the client with a stale renderer is what
|
||||||
# produced the "Expected 14-15 arguments, but got 16" failure on
|
# produced the "Expected 14-15 arguments, but got 16" failure on
|
||||||
# the catalog edit composer.
|
# the catalog edit composer. When a feature touches both repos,
|
||||||
#
|
# point RENDERER_REPO/RENDERER_REF (or the dispatch inputs) at the
|
||||||
# This branch (`feat/housekeeping-panel`) references HK composers
|
# companion renderer branch.
|
||||||
# /events that live on the renderer PR branch
|
|
||||||
# (simoleo89/Nitro_Render_V3 @ feat/housekeeping-packets) — they
|
|
||||||
# haven't been merged upstream yet. Pair against the fork branch
|
|
||||||
# for this PR so the typecheck step can resolve the imports;
|
|
||||||
# once the renderer PR lands on duckietm:Dev this whole
|
|
||||||
# special-case block can be dropped.
|
|
||||||
#
|
|
||||||
# Mapping:
|
|
||||||
# client `main` → duckietm/Nitro_Render_V3 @ main
|
|
||||||
# client `feat/housekeeping-panel` → simoleo89/Nitro_Render_V3 @ feat/housekeeping-packets
|
|
||||||
# client `feat/**` (other) → duckietm/Nitro_Render_V3 @ Dev
|
|
||||||
# PR base `main` → duckietm/Nitro_Render_V3 @ main
|
|
||||||
# PR head `feat/housekeeping-panel` → simoleo89/Nitro_Render_V3 @ feat/housekeeping-packets
|
|
||||||
# PR base `Dev` (upstream) → duckietm/Nitro_Render_V3 @ Dev
|
|
||||||
# PR base `feat/**` → duckietm/Nitro_Render_V3 @ Dev
|
|
||||||
#
|
|
||||||
# Override via workflow_dispatch inputs when you need an ad-hoc
|
|
||||||
# pairing.
|
|
||||||
- name: Resolve renderer ref
|
- name: Resolve renderer ref
|
||||||
id: renderer
|
id: renderer
|
||||||
|
env:
|
||||||
|
IN_REPO: ${{ github.event.inputs.renderer_repo }}
|
||||||
|
IN_REF: ${{ github.event.inputs.renderer_ref }}
|
||||||
|
VAR_REPO: ${{ vars.RENDERER_REPO }}
|
||||||
|
VAR_REF: ${{ vars.RENDERER_REF }}
|
||||||
run: |
|
run: |
|
||||||
REPO="${{ github.event.inputs.renderer_repo }}"
|
set -euo pipefail
|
||||||
REF="${{ github.event.inputs.renderer_ref }}"
|
|
||||||
|
|
||||||
if [ -z "$REPO" ] || [ -z "$REF" ]; then
|
# Branch context of the *client* build.
|
||||||
# For PRs we usually pair against the base ref, but the HK
|
case "${GITHUB_EVENT_NAME}" in
|
||||||
# PR specifically needs to pair against its OWN head ref —
|
pull_request) CTX="${GITHUB_BASE_REF}" ;;
|
||||||
# the renderer companion PR is named identically
|
*) CTX="${GITHUB_REF_NAME}" ;;
|
||||||
# (`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
|
# Upstream fallback ref depends on client context.
|
||||||
main)
|
if [ "$CTX" = "main" ]; then
|
||||||
AUTO_REPO="duckietm/Nitro_Render_V3"
|
DEFAULT_REF="main"
|
||||||
AUTO_REF="main"
|
else
|
||||||
;;
|
DEFAULT_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
|
fi
|
||||||
|
|
||||||
|
# Precedence: dispatch input → repo variable → upstream default.
|
||||||
|
REPO="$IN_REPO"
|
||||||
|
[ -z "$REPO" ] && REPO="$VAR_REPO"
|
||||||
|
[ -z "$REPO" ] && REPO="$UPSTREAM_RENDERER_REPO"
|
||||||
|
|
||||||
|
REF="$IN_REF"
|
||||||
|
[ -z "$REF" ] && REF="$VAR_REF"
|
||||||
|
[ -z "$REF" ] && REF="$DEFAULT_REF"
|
||||||
|
|
||||||
echo "repo=$REPO" >> "$GITHUB_OUTPUT"
|
echo "repo=$REPO" >> "$GITHUB_OUTPUT"
|
||||||
echo "ref=$REF" >> "$GITHUB_OUTPUT"
|
echo "ref=$REF" >> "$GITHUB_OUTPUT"
|
||||||
echo "Resolved renderer pairing: $REPO @ $REF (client ctx: ${GITHUB_BASE_REF:-$GITHUB_REF_NAME}, event: ${GITHUB_EVENT_NAME})"
|
echo "Resolved renderer pairing: $REPO @ $REF (client ctx: $CTX, event: ${GITHUB_EVENT_NAME})"
|
||||||
|
|
||||||
- name: Checkout Nitro_Render_V3 (sibling)
|
- name: Checkout Nitro_Render_V3 (sibling)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user