Network Manager refactor
This commit is contained in:
@@ -24,13 +24,19 @@
|
||||
#
|
||||
|
||||
name: Build Diskless UKI
|
||||
run-name: ${{ gitea.actor }} builds the diskless fleet UKI
|
||||
run-name: ${{ gitea.actor }} builds the diskless fleet UKI (${{ gitea.ref_name }})
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
- "**" # every branch — feature branches get a branch-name+sha tag
|
||||
tags:
|
||||
- "v*"
|
||||
- "v*" # tag push -> clean semver tag (v1.2.3 -> 1.2.3)
|
||||
|
||||
# One build per ref at a time; a newer push to the same branch cancels the
|
||||
# in-flight build (each build is a ~17-min VM run, so don't stack them).
|
||||
concurrency:
|
||||
group: uki-build-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
PRODUCT_VERSION: "1.15.4" # Packer version
|
||||
@@ -68,13 +74,26 @@ jobs:
|
||||
-
|
||||
name: Derive image version
|
||||
id: vars
|
||||
# Tag push (v1.2.3 -> 1.2.3); otherwise 0.0.0-<short-sha>.
|
||||
# This becomes the OCI tag (build-oci.sh tags ${oci_image}:${image_version})
|
||||
# and the artifact dir name. Two cases:
|
||||
# - tag push (refs/tags/v1.2.3) -> "1.2.3" (release)
|
||||
# - branch push (refs/heads/<name>) -> "<name>-<sha7>" (dev image)
|
||||
# The branch name is sanitized to the OCI tag charset
|
||||
# ([A-Za-z0-9._-], <=128, no leading . or -): e.g. feature/foo -> feature-foo,
|
||||
# giving feature-foo-ab12cd3. So every branch yields a uniquely tagged,
|
||||
# pushed image you can boot/test without clobbering main or releases.
|
||||
run: |
|
||||
ref="${GITHUB_REF#refs/*/}"
|
||||
short_sha="$(echo "${GITHUB_SHA}" | cut -c1-7)"
|
||||
if [ "${GITHUB_REF#refs/tags/}" != "$GITHUB_REF" ]; then
|
||||
version="${ref#v}"
|
||||
version="${GITHUB_REF#refs/tags/}"
|
||||
version="${version#v}"
|
||||
else
|
||||
version="0.0.0-$(echo "${GITHUB_SHA}" | cut -c1-7)"
|
||||
branch="${GITHUB_REF#refs/heads/}"
|
||||
# invalid chars -> '-'; trim leading '.'/'-'; cap length headroom for -sha7
|
||||
safe_branch="$(printf '%s' "$branch" \
|
||||
| sed -e 's#[^A-Za-z0-9._-]#-#g' -e 's#^[.-]*##' | cut -c1-100)"
|
||||
[ -n "$safe_branch" ] || safe_branch="branch"
|
||||
version="${safe_branch}-${short_sha}"
|
||||
fi
|
||||
echo "image_version=${version}" >> "$GITHUB_OUTPUT"
|
||||
echo "Building image_version=${version}"
|
||||
|
||||
Reference in New Issue
Block a user