Update workflows to use Panel-stable and Panel-unstable branch names
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/e419b138-7289-46d7-b7be-6c9e455f47af Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
e2a5d3d1c4
commit
677d685e8a
2 changed files with 45 additions and 56 deletions
30
.github/workflows/create-release.yml
vendored
30
.github/workflows/create-release.yml
vendored
|
|
@ -24,29 +24,17 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
# 1. Checkout the full repository history so we
|
# 1. Checkout Panel-stable with full history so
|
||||||
# can inspect branches and create tags.
|
# we can inspect branches and create tags.
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
- name: Checkout repository
|
- name: Checkout Panel-stable
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
ref: Panel-stable
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
# 2. Safety: only allow releases from the
|
# 2. Safety: abort if the tag already exists to
|
||||||
# "stable" branch.
|
|
||||||
# ──────────────────────────────────────────────
|
|
||||||
- name: Verify we are on the stable branch
|
|
||||||
run: |
|
|
||||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
||||||
echo "Current branch: ${BRANCH}"
|
|
||||||
if [ "${BRANCH}" != "stable" ]; then
|
|
||||||
echo "::error::Releases must be created from the 'stable' branch. Current branch is '${BRANCH}'."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ──────────────────────────────────────────────
|
|
||||||
# 3. Safety: abort if the tag already exists to
|
|
||||||
# prevent accidental overwrites.
|
# prevent accidental overwrites.
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
- name: Check that tag does not already exist
|
- name: Check that tag does not already exist
|
||||||
|
|
@ -60,8 +48,8 @@ jobs:
|
||||||
echo "Tag '${VERSION}' does not exist yet — safe to proceed."
|
echo "Tag '${VERSION}' does not exist yet — safe to proceed."
|
||||||
|
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
# 4. Create the annotated git tag locally and
|
# 3. Create the annotated git tag on Panel-stable
|
||||||
# push it to origin.
|
# and push it to origin.
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
- name: Create and push git tag
|
- name: Create and push git tag
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -73,7 +61,7 @@ jobs:
|
||||||
echo "Tag '${VERSION}' pushed to origin."
|
echo "Tag '${VERSION}' pushed to origin."
|
||||||
|
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
# 5. Build the release ZIP, excluding files that
|
# 4. Build the release ZIP, excluding files that
|
||||||
# should never ship (secrets, dev artifacts,
|
# should never ship (secrets, dev artifacts,
|
||||||
# version-control metadata, etc.).
|
# version-control metadata, etc.).
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
|
|
@ -102,7 +90,7 @@ jobs:
|
||||||
ls -lh "${ARCHIVE}"
|
ls -lh "${ARCHIVE}"
|
||||||
|
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
# 6. Create the GitHub Release and upload the
|
# 5. Create the GitHub Release and upload the
|
||||||
# ZIP asset. Uses only the built-in
|
# ZIP asset. Uses only the built-in
|
||||||
# GITHUB_TOKEN — no personal token needed.
|
# GITHUB_TOKEN — no personal token needed.
|
||||||
# ──────────────────────────────────────────────
|
# ──────────────────────────────────────────────
|
||||||
|
|
|
||||||
71
.github/workflows/promote-unstable-to-stable.yml
vendored
71
.github/workflows/promote-unstable-to-stable.yml
vendored
|
|
@ -1,15 +1,15 @@
|
||||||
name: Promote Unstable to Stable
|
name: Promote Unstable to Stable
|
||||||
|
|
||||||
# This workflow is MANUAL-ONLY.
|
# This workflow is MANUAL-ONLY.
|
||||||
# It overwrites the stable branch with the exact contents of unstable.
|
# It overwrites Panel-stable with the exact contents of Panel-unstable.
|
||||||
# No merge is performed — stable becomes identical to unstable (force push).
|
# No merge is performed — Panel-stable becomes identical to Panel-unstable (force push).
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
promote:
|
promote:
|
||||||
name: Overwrite stable with unstable
|
name: Overwrite Panel-stable with Panel-unstable
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
|
@ -21,67 +21,68 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Full history so all branches are available
|
fetch-depth: 0 # Full history so all branches are available
|
||||||
|
|
||||||
- name: Fetch both branches
|
- name: Fetch Panel-unstable and Panel-stable
|
||||||
run: |
|
run: |
|
||||||
git fetch origin unstable stable
|
git fetch origin Panel-unstable Panel-stable
|
||||||
|
|
||||||
- name: Verify unstable branch exists
|
- name: Verify Panel-unstable branch exists
|
||||||
run: |
|
run: |
|
||||||
if ! git rev-parse --verify origin/unstable > /dev/null 2>&1; then
|
if ! git rev-parse --verify origin/Panel-unstable > /dev/null 2>&1; then
|
||||||
echo "ERROR: Branch 'unstable' does not exist on origin. Aborting."
|
echo "ERROR: Branch 'Panel-unstable' does not exist on origin. Aborting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Branch 'unstable' confirmed."
|
echo "Branch 'Panel-unstable' confirmed."
|
||||||
|
|
||||||
- name: Verify stable branch exists
|
- name: Verify Panel-stable branch exists
|
||||||
run: |
|
run: |
|
||||||
if ! git rev-parse --verify origin/stable > /dev/null 2>&1; then
|
if ! git rev-parse --verify origin/Panel-stable > /dev/null 2>&1; then
|
||||||
echo "ERROR: Branch 'stable' does not exist on origin. Aborting."
|
echo "ERROR: Branch 'Panel-stable' does not exist on origin. Aborting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Branch 'stable' confirmed."
|
echo "Branch 'Panel-stable' confirmed."
|
||||||
|
|
||||||
- name: Show current commit hashes before update
|
- name: Show commit hashes before update
|
||||||
run: |
|
run: |
|
||||||
UNSTABLE_COMMIT=$(git rev-parse origin/unstable)
|
UNSTABLE_COMMIT=$(git rev-parse origin/Panel-unstable)
|
||||||
STABLE_COMMIT=$(git rev-parse origin/stable)
|
STABLE_COMMIT=$(git rev-parse origin/Panel-stable)
|
||||||
echo "Current unstable commit : $UNSTABLE_COMMIT"
|
echo "Panel-unstable commit : $UNSTABLE_COMMIT"
|
||||||
echo "Current stable commit : $STABLE_COMMIT"
|
echo "Panel-stable commit (before) : $STABLE_COMMIT"
|
||||||
echo "UNSTABLE_COMMIT=$UNSTABLE_COMMIT" >> "$GITHUB_ENV"
|
echo "UNSTABLE_COMMIT=$UNSTABLE_COMMIT" >> "$GITHUB_ENV"
|
||||||
echo "STABLE_BEFORE=$STABLE_COMMIT" >> "$GITHUB_ENV"
|
echo "STABLE_BEFORE=$STABLE_COMMIT" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Check out stable locally
|
- name: Check out Panel-stable locally
|
||||||
run: |
|
run: |
|
||||||
git checkout stable
|
git checkout -B Panel-stable origin/Panel-stable
|
||||||
|
|
||||||
- name: Reset stable to match unstable exactly
|
- name: Reset Panel-stable to match Panel-unstable exactly
|
||||||
# This is NOT a merge. We hard-reset stable to the same commit as unstable.
|
# This is NOT a merge. We hard-reset Panel-stable to the same commit as Panel-unstable.
|
||||||
# After this step, stable and unstable are byte-for-byte identical.
|
# After this step, Panel-stable and Panel-unstable are byte-for-byte identical.
|
||||||
run: |
|
run: |
|
||||||
git reset --hard origin/unstable
|
git reset --hard origin/Panel-unstable
|
||||||
|
|
||||||
- name: Force push stable to origin
|
- name: Force push Panel-stable to origin
|
||||||
# --force is intentional: we are deliberately replacing stable with unstable.
|
# --force is intentional: we are deliberately replacing Panel-stable with Panel-unstable.
|
||||||
# GITHUB_TOKEN is sufficient for repositories where the actor has write access.
|
# GITHUB_TOKEN is sufficient for repositories where the actor has write access.
|
||||||
run: |
|
run: |
|
||||||
git push origin stable --force
|
git push origin Panel-stable --force
|
||||||
|
|
||||||
- name: Show stable commit after update
|
- name: Show Panel-stable commit after update
|
||||||
run: |
|
run: |
|
||||||
git fetch origin stable
|
git fetch origin Panel-stable
|
||||||
STABLE_AFTER=$(git rev-parse origin/stable)
|
STABLE_AFTER=$(git rev-parse origin/Panel-stable)
|
||||||
echo "-------------------------------------------"
|
echo "-------------------------------------------"
|
||||||
echo "Promotion summary"
|
echo "Promotion summary"
|
||||||
echo "-------------------------------------------"
|
echo "-------------------------------------------"
|
||||||
echo "unstable commit : $UNSTABLE_COMMIT"
|
echo "Panel-unstable commit : $UNSTABLE_COMMIT"
|
||||||
echo "stable commit (before) : $STABLE_BEFORE"
|
echo "Panel-stable commit (before) : $STABLE_BEFORE"
|
||||||
echo "stable commit (after) : $STABLE_AFTER"
|
echo "Panel-stable commit (after) : $STABLE_AFTER"
|
||||||
echo "-------------------------------------------"
|
echo "-------------------------------------------"
|
||||||
if [ "$STABLE_AFTER" = "$UNSTABLE_COMMIT" ]; then
|
if [ "$STABLE_AFTER" = "$UNSTABLE_COMMIT" ]; then
|
||||||
echo "SUCCESS: stable now matches unstable."
|
echo "SUCCESS: Panel-stable now matches Panel-unstable."
|
||||||
else
|
else
|
||||||
echo "WARNING: stable commit does not match expected unstable commit."
|
echo "WARNING: Panel-stable commit does not match expected Panel-unstable commit."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue