mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-01 19:18:28 -04:00
refactor(workflows): update release refs to stable in CI configurations
Port 1.5
This commit is contained in:
@@ -45,7 +45,7 @@ jobs:
|
|||||||
git push "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" HEAD:refs/heads/stable --force
|
git push "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" HEAD:refs/heads/stable --force
|
||||||
|
|
||||||
cut-release-branch:
|
cut-release-branch:
|
||||||
# create release/X.Y at each vX.Y.0 tag
|
# create stable-X.Y at each vX.Y.0 tag
|
||||||
if: ${{ !contains(github.ref_name, '-') }}
|
if: ${{ !contains(github.ref_name, '-') }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -71,7 +71,7 @@ jobs:
|
|||||||
echo "not a vX.Y.0 tag, no release branch to cut"
|
echo "not a vX.Y.0 tag, no release branch to cut"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
branch="release/${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
|
branch="stable-${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
|
||||||
if git ls-remote --exit-code origin "refs/heads/${branch}" >/dev/null 2>&1; then
|
if git ls-remote --exit-code origin "refs/heads/${branch}" >/dev/null 2>&1; then
|
||||||
echo "${branch} already exists"
|
echo "${branch} already exists"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ on:
|
|||||||
- "core/**"
|
- "core/**"
|
||||||
- ".github/workflows/go-ci.yml"
|
- ".github/workflows/go-ci.yml"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master, main, "release/**"]
|
branches: [master, main, "stable-*"]
|
||||||
paths:
|
paths:
|
||||||
- "core/**"
|
- "core/**"
|
||||||
- ".github/workflows/go-ci.yml"
|
- ".github/workflows/go-ci.yml"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: Nix flake and NixOS tests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master, main, "release/**"]
|
branches: [master, main, "stable-*"]
|
||||||
paths:
|
paths:
|
||||||
- "flake.*"
|
- "flake.*"
|
||||||
- "distro/nix/**"
|
- "distro/nix/**"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: Point release
|
name: Point release
|
||||||
|
|
||||||
# Cuts vX.Y.Z from release/X.Y: runs the port audit (warn-only), bumps
|
# Cuts vX.Y.Z from stable-X.Y: runs the port audit (warn-only), bumps
|
||||||
# quickshell/VERSION, tags, and dispatches the Release workflow. Distro
|
# quickshell/VERSION, tags, and dispatches the Release workflow. Distro
|
||||||
# builds are dispatched separately.
|
# builds are dispatched separately.
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
echo "::error::version must be X.Y.Z (got '$VERSION')"; exit 1
|
echo "::error::version must be X.Y.Z (got '$VERSION')"; exit 1
|
||||||
fi
|
fi
|
||||||
echo "branch=release/${VERSION%.*}" >> "$GITHUB_OUTPUT"
|
echo "branch=stable-${VERSION%.*}" >> "$GITHUB_OUTPUT"
|
||||||
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
|
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Create GitHub App token
|
- name: Create GitHub App token
|
||||||
|
|||||||
+11
-11
@@ -1,10 +1,10 @@
|
|||||||
name: Port to release branch
|
name: Port to release branch
|
||||||
|
|
||||||
# Ports flagged commits from master onto release/X.Y branches:
|
# Ports flagged commits from master onto stable-X.Y branches:
|
||||||
# - "port 1.5" flag in a commit message pushed to master — own line or
|
# - "port 1.5" flag in a commit message pushed to master — own line or
|
||||||
# mid-line; separators : / - or space; "release/1.5" also accepted;
|
# mid-line; separators : / - or space; "stable-1.5" also accepted;
|
||||||
# comma lists ("Port: 1.5, 1.4") work in the own-line form
|
# comma lists ("Port: 1.5, 1.4") work in the own-line form
|
||||||
# - "port release/1.5" label on a merged PR
|
# - "port stable-1.5" label on a merged PR
|
||||||
# Conflicts are reported to the "Port status: <branch>" tracking issue.
|
# Conflicts are reported to the "Port status: <branch>" tracking issue.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -59,16 +59,16 @@ jobs:
|
|||||||
# own-line form (supports comma lists), validated version-shaped
|
# own-line form (supports comma lists), validated version-shaped
|
||||||
t1=$(git log -1 --format=%B "$sha" |
|
t1=$(git log -1 --format=%B "$sha" |
|
||||||
{ grep -iE '^Port[:/ -]' || true; } | sed -E 's|^port[-:/ ]+||I' | tr ',' '\n' |
|
{ grep -iE '^Port[:/ -]' || true; } | sed -E 's|^port[-:/ ]+||I' | tr ',' '\n' |
|
||||||
sed 's/[[:space:]]//g; /^$/d' | sed 's|^release/||I' |
|
sed 's/[[:space:]]//g; /^$/d' | sed -E 's,^stable-,,I' |
|
||||||
{ grep -E '^[0-9]+\.[0-9]+(\.[0-9]+)?$' || true; })
|
{ grep -E '^[0-9]+\.[0-9]+(\.[0-9]+)?$' || true; })
|
||||||
# mid-line form, e.g. "fix thing fixes #2802 port 1.5"
|
# mid-line form, e.g. "fix thing fixes #2802 port 1.5"
|
||||||
t2=$(git log -1 --format=%B "$sha" |
|
t2=$(git log -1 --format=%B "$sha" |
|
||||||
{ grep -oiE '\bport[-: /]+(release/)?[0-9]+\.[0-9]+(\.[0-9]+)?\b' || true; } |
|
{ grep -oiE '\bport[-: /]+(stable-)?[0-9]+\.[0-9]+(\.[0-9]+)?\b' || true; } |
|
||||||
sed -E 's|^port[-:/ ]+||I' | sed 's|^release/||I')
|
sed -E 's|^port[-:/ ]+||I' | sed -E 's,^stable-,,I')
|
||||||
targets=$(printf '%s\n%s\n' "$t1" "$t2" | sed '/^$/d' | sort -u)
|
targets=$(printf '%s\n%s\n' "$t1" "$t2" | sed '/^$/d' | sort -u)
|
||||||
for ver in $targets; do
|
for ver in $targets; do
|
||||||
echo "::group::port $sha -> release/$ver"
|
echo "::group::port $sha -> stable-$ver"
|
||||||
bash scripts/port.sh "release/$ver" "$sha"
|
bash scripts/port.sh "stable-$ver" "$sha"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
@@ -90,12 +90,12 @@ jobs:
|
|||||||
git config user.email "dms-ci[bot]@users.noreply.github.com"
|
git config user.email "dms-ci[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
targets=$(jq -r '.[] | select(startswith("port ")) | sub("^port +"; "")' <<<"$LABELS" |
|
targets=$(jq -r '.[] | select(startswith("port ")) | sub("^port +"; "")' <<<"$LABELS" |
|
||||||
sed 's|^release/||' | sort -u)
|
sed -E 's,^stable-,,' | sort -u)
|
||||||
[ -n "$targets" ] || { echo "no port labels, nothing to do"; exit 0; }
|
[ -n "$targets" ] || { echo "no port labels, nothing to do"; exit 0; }
|
||||||
[ -n "$MERGE_SHA" ] || { echo "::error::PR has no merge commit sha"; exit 1; }
|
[ -n "$MERGE_SHA" ] || { echo "::error::PR has no merge commit sha"; exit 1; }
|
||||||
|
|
||||||
for ver in $targets; do
|
for ver in $targets; do
|
||||||
echo "::group::port PR #${PORT_SOURCE_PR} ($MERGE_SHA) -> release/$ver"
|
echo "::group::port PR #${PORT_SOURCE_PR} ($MERGE_SHA) -> stable-$ver"
|
||||||
bash scripts/port.sh "release/$ver" "$MERGE_SHA"
|
bash scripts/port.sh "stable-$ver" "$MERGE_SHA"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ name: Pre-commit Checks
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [master, main, "release/**"]
|
branches: [master, main, "stable-*"]
|
||||||
jobs:
|
jobs:
|
||||||
pre-commit-check:
|
pre-commit-check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Usage: port-audit.sh [<target-branch>] [--issue]
|
# Usage: port-audit.sh [<target-branch>] [--issue]
|
||||||
#
|
#
|
||||||
# Target defaults to the newest origin/release/* branch. --issue writes the
|
# Target defaults to the newest origin/stable-* branch. --issue writes the
|
||||||
# report to the "Port status: <target>" tracking issue body (needs gh auth).
|
# report to the "Port status: <target>" tracking issue body (needs gh auth).
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -19,9 +19,9 @@ done
|
|||||||
git fetch origin --quiet 2>/dev/null || true
|
git fetch origin --quiet 2>/dev/null || true
|
||||||
|
|
||||||
if [ -z "$TARGET" ]; then
|
if [ -z "$TARGET" ]; then
|
||||||
TARGET=$(git branch -r --list 'origin/release/*' --format='%(refname:short)' |
|
TARGET=$(git branch -r --list 'origin/stable-*' --format='%(refname:short)' |
|
||||||
sed 's|^origin/||' | sort -V | tail -1)
|
sed 's|^origin/||' | sort -V | tail -1)
|
||||||
[ -n "$TARGET" ] || { echo "error: no origin/release/* branch found" >&2; exit 1; }
|
[ -n "$TARGET" ] || { echo "error: no origin/stable-* branch found" >&2; exit 1; }
|
||||||
fi
|
fi
|
||||||
git rev-parse --verify "origin/${TARGET}" >/dev/null 2>&1 ||
|
git rev-parse --verify "origin/${TARGET}" >/dev/null 2>&1 ||
|
||||||
{ echo "error: branch origin/${TARGET} not found" >&2; exit 1; }
|
{ echo "error: branch origin/${TARGET} not found" >&2; exit 1; }
|
||||||
@@ -42,8 +42,8 @@ flagged=""
|
|||||||
fix_count=0
|
fix_count=0
|
||||||
other_count=0
|
other_count=0
|
||||||
flagged_count=0
|
flagged_count=0
|
||||||
VER="${TARGET#release/}"
|
VER="${TARGET#stable-}"
|
||||||
FLAG_RE="\\bport[-: /]+(release/)?${VER//./\\.}\\b"
|
FLAG_RE="\\bport[-: /]+(stable-)?${VER//./\\.}\\b"
|
||||||
while read -r mark sha; do
|
while read -r mark sha; do
|
||||||
[ "$mark" = "+" ] || continue
|
[ "$mark" = "+" ] || continue
|
||||||
[ -n "${PORTED[$sha]:-}" ] && continue
|
[ -n "${PORTED[$sha]:-}" ] && continue
|
||||||
|
|||||||
+2
-1
@@ -50,7 +50,8 @@ report_conflict() {
|
|||||||
local sha="$1" short subject branch issue
|
local sha="$1" short subject branch issue
|
||||||
short=$(git rev-parse --short "$sha")
|
short=$(git rev-parse --short "$sha")
|
||||||
subject=$(git log -1 --format=%s "$sha")
|
subject=$(git log -1 --format=%s "$sha")
|
||||||
branch="port/${short}-${TARGET#release/}"
|
local ver="${TARGET#stable-}"
|
||||||
|
branch="port/${short}-${ver}"
|
||||||
git push origin "refs/remotes/origin/${TARGET}:refs/heads/${branch}" 2>/dev/null ||
|
git push origin "refs/remotes/origin/${TARGET}:refs/heads/${branch}" 2>/dev/null ||
|
||||||
log "conflict branch ${branch} already exists"
|
log "conflict branch ${branch} already exists"
|
||||||
issue=$(tracking_issue)
|
issue=$(tracking_issue)
|
||||||
|
|||||||
Reference in New Issue
Block a user