Skip to content

Commit

Permalink
generate build args
Browse files Browse the repository at this point in the history
  • Loading branch information
p5 committed Dec 21, 2024
1 parent 6abd04d commit b5878e2
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/reusable-generate-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ jobs:
image-registry: ${{ inputs.image-registry }}
image-name: ${{ inputs.image-name }}
build-args: ${{ steps.set-metadata.outputs.BUILD_ARGS }}
tags: ${{ steps.generate-tags.outputs.TAGS }}
tags: ${{ steps.set-metadata.outputs.TAGS }}
steps:
- name: Fetch Kernel Version
id: fetch-kernel-version
env:
IMAGE_REGISTRY: ${{ inputs.image-registry }}
FEDORA_VERSION: ${{ inputs.fedora-version }}
run: |
KERNEL_VERSION=$(skopeo inspect docker://${IMAGE_REGISTRY}/main-kernel:${FEDORA_VERSION} | jq -r '.Labels["ostree.linux"]')
Expand All @@ -66,6 +69,7 @@ jobs:
IS_LATEST_VERSION: ${{ inputs.is-latest }}
IS_GTS_VERSION: ${{ inputs.is-gts }}
IS_BETA_VERSION: ${{ inputs.is-beta }}
FEDORA_VERSION: ${{ inputs.fedora-version }}
run: |
TIMESTAMP="$(date +%Y%m%d)"
SHA_SHORT="${GITHUB_SHA::7}"
Expand All @@ -89,3 +93,28 @@ jobs:
done
echo "TAGS=$(IFS=,; echo "${TAGS[*]}")" >> $GITHUB_OUTPUT
- name: Generate Build Args
id: generate-build-args
env:
KERNEL_VERSION: ${{ steps.fetch-kernel-version.outputs.KERNEL_VERSION }}
FEDORA_VERSION: ${{ inputs.fedora-version }}
IMAGE_NAME: ${{ inputs.image-name }}
run: |
BUILD_ARGS=()
BUILD_ARGS+=("KERNEL_VERSION=${KERNEL_VERSION}")
BUILD_ARGS+=("SOURCE_IMAGE=${SOURCE_IMAGE}")
BUILD_ARGS+=("FEDORA_MAJOR_VERSION=${FEDORA_VERSION}")
BUILD_ARGS+=("IMAGE_NAME=${IMAGE_NAME}")
echo "BUILD_ARGS=$(IFS=,; echo "${BUILD_ARGS[*]}")" >> $GITHUB_OUTPUT
- name: Set Metadata
id: set-metadata
env:
BUILD_ARGS: ${{ steps.generate-build-args.outputs.BUILD_ARGS }}
TAGS: ${{ steps.generate-tags.outputs.TAGS }}
run: |
echo "BUILD_ARGS=${BUILD_ARGS}" >> $GITHUB_OUTPUT
echo "TAGS=${TAGS}" >> $GITHUB_OUTPUT

0 comments on commit b5878e2

Please sign in to comment.