Seed/update .ci pipeline from manifest-updater v1.1.0
This commit is contained in:
+11
-7
@@ -39,6 +39,15 @@ if os.path.isfile("mu-release.yaml"):
|
|||||||
print("true" if val is True else "false" if val is False else val)
|
print("true" if val is True else "false" if val is False else val)
|
||||||
PY
|
PY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Builder/config deps up front: cfg() parses YAML and build-manifest needs
|
||||||
|
# markdown + pyyaml. Installing here (not mid-pipeline) so CHANNEL/APP_BUILD and
|
||||||
|
# every later YAML read resolve correctly.
|
||||||
|
command -v python3 >/dev/null 2>&1 || { sudo apt-get update -qq && sudo apt-get install -y -qq python3; }
|
||||||
|
python3 -m pip --version >/dev/null 2>&1 || { sudo apt-get update -qq && sudo apt-get install -y -qq python3-pip; }
|
||||||
|
python3 -m pip install --quiet markdown pyyaml 2>/dev/null \
|
||||||
|
|| python3 -m pip install --quiet --break-system-packages markdown pyyaml
|
||||||
|
|
||||||
CHANNEL="$(cfg channel 'ee-extensions/foh-updates')"
|
CHANNEL="$(cfg channel 'ee-extensions/foh-updates')"
|
||||||
APP_BUILD="$(cfg app_build 'false')"
|
APP_BUILD="$(cfg app_build 'false')"
|
||||||
|
|
||||||
@@ -103,12 +112,12 @@ API="${HOST}/api/v1/repos/${GITHUB_REPOSITORY}"
|
|||||||
AUTH="Authorization: token ${GITHUB_TOKEN}"
|
AUTH="Authorization: token ${GITHUB_TOKEN}"
|
||||||
# Idempotent: reuse the release if this tag was already released (re-run/re-tag).
|
# Idempotent: reuse the release if this tag was already released (re-run/re-tag).
|
||||||
REL="$(curl -fsS -H "${AUTH}" "${API}/releases/tags/${GITHUB_REF_NAME}" 2>/dev/null || true)"
|
REL="$(curl -fsS -H "${AUTH}" "${API}/releases/tags/${GITHUB_REF_NAME}" 2>/dev/null || true)"
|
||||||
REL_ID="$(printf '%s' "${REL}" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')"
|
REL_ID="$(printf '%s' "${REL}" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*' || true)"
|
||||||
if [ -z "${REL_ID}" ]; then
|
if [ -z "${REL_ID}" ]; then
|
||||||
BODY="$(python3 -c 'import json,sys; print(json.dumps({"tag_name":sys.argv[1],"name":sys.argv[2],"body":sys.argv[3]}))' \
|
BODY="$(python3 -c 'import json,sys; print(json.dumps({"tag_name":sys.argv[1],"name":sys.argv[2],"body":sys.argv[3]}))' \
|
||||||
"${GITHUB_REF_NAME}" "${SLUG} ${VER}" "Automated build of ${GITHUB_REF_NAME}.")"
|
"${GITHUB_REF_NAME}" "${SLUG} ${VER}" "Automated build of ${GITHUB_REF_NAME}.")"
|
||||||
REL="$(curl -fsS -X POST "${API}/releases" -H "${AUTH}" -H "Content-Type: application/json" --data-raw "${BODY}")"
|
REL="$(curl -fsS -X POST "${API}/releases" -H "${AUTH}" -H "Content-Type: application/json" --data-raw "${BODY}")"
|
||||||
REL_ID="$(printf '%s' "${REL}" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')"
|
REL_ID="$(printf '%s' "${REL}" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*' || true)"
|
||||||
fi
|
fi
|
||||||
[ -n "${REL_ID}" ] || { echo "::error::could not create/get the release"; echo "${REL}"; exit 1; }
|
[ -n "${REL_ID}" ] || { echo "::error::could not create/get the release"; echo "${REL}"; exit 1; }
|
||||||
# Replace a same-named asset on a re-run rather than 409-ing.
|
# Replace a same-named asset on a re-run rather than 409-ing.
|
||||||
@@ -156,11 +165,6 @@ d["icons"] = json.loads(sys.argv[10])
|
|||||||
json.dump(d, sys.stdout)
|
json.dump(d, sys.stdout)
|
||||||
PY
|
PY
|
||||||
|
|
||||||
# ensure python3 + pip + the builder's deps (markdown, pyyaml) are present.
|
|
||||||
command -v python3 >/dev/null 2>&1 || { sudo apt-get update -qq && sudo apt-get install -y -qq python3; }
|
|
||||||
python3 -m pip --version >/dev/null 2>&1 || { sudo apt-get update -qq && sudo apt-get install -y -qq python3-pip; }
|
|
||||||
python3 -m pip install --quiet markdown pyyaml 2>/dev/null \
|
|
||||||
|| python3 -m pip install --quiet --break-system-packages markdown pyyaml
|
|
||||||
# Prefer the tag-locked local builder (MU ships .ci/); consumer plugins fall back
|
# Prefer the tag-locked local builder (MU ships .ci/); consumer plugins fall back
|
||||||
# to the channel copy seeded by MU's release. (Keep FOH_UPDATES_DEPLOY_KEY tightly held.)
|
# to the channel copy seeded by MU's release. (Keep FOH_UPDATES_DEPLOY_KEY tightly held.)
|
||||||
BUILDER="_upd/.ci/build-manifest.py"
|
BUILDER="_upd/.ci/build-manifest.py"
|
||||||
|
|||||||
Reference in New Issue
Block a user