Skip to content

Commit

Permalink
chore: match commit tags to build tags
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed Jul 10, 2024
1 parent 22d2f87 commit 8e02b2f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
attempt_limit: 3
attempt_delay: 15000
command: |
set -x
build_image="quay.io/fedora/fedora:${{ matrix.fedora_version }}"
echo "build_image=$build_image" >> "$GITHUB_ENV"
podman pull "$build_image"
Expand All @@ -66,7 +65,6 @@ jobs:
attempt_limit: 3
attempt_delay: 15000
command: |
set -x
if [[ ${{ matrix.kernel_flavor }} =~ asus|fsync|surface ]]; then
container_name="fq-$(uuidgen)"
dnf="podman exec $container_name dnf"
Expand Down Expand Up @@ -114,38 +112,39 @@ jobs:
minor=$(echo "$linux" | cut -d '.' -f 2)
patch=$(echo "$linux" | cut -d '.' -f 3)
kernel_major_minor_patch="${major}.${minor}.${patch}"
echo "Kernel Version is ${linux}"
echo "kernel_release=${linux}" >> $GITHUB_ENV
echo "kernel_major_minor_patch=${kernel_major_minor_patch}" >> $GITHUB_ENV
- name: Generate Tags
id: generate_tags
shell: bash
run: |
set -x
tag="${{ env.kernel_release }}"
short_tag=$(echo ${{ env.kernel_major_minor_patch }} | cut -d "-" -f 1)
COMMIT_TAGS=()
COMMIT_TAGS+=("pr-${{ github.event.number }}-${tag}")
COMMIT_TAGS+=("${GITHUB_SHA::7}-${tag}")
COMMIT_TAGS+=("pr-${{ github.event.number }}-${{ matrix.fedora_version }}")
COMMIT_TAGS+=("pr-${{ github.event.number }}-${{ matrix.fedora_version }}-${short_tag}")
COMMIT_TAGS+=("pr-${{ github.event.number }}-${tag}")
COMMIT_TAGS+=("${GITHUB_SHA::7}-${{ matrix.fedora_version }}")
COMMIT_TAGS+=("${GITHUB_SHA::7}-${{ matrix.fedora_version }}-${short_tag}")
COMMIT_TAGS+=("${GITHUB_SHA::7}-${tag}")
BUILD_TAGS=()
BUILD_TAGS+=(${tag})
BUILD_TAGS+=("${{ matrix.fedora_version }}")
BUILD_TAGS+=(${{ matrix.fedora_version }}-${short_tag})
BUILD_TAGS+=(${tag})
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Generated the following commit tags: "
for TAG in "${COMMIT_TAGS[@]}"; do
echo "${TAG}"
done
# echo "Generated the following commit tags: "
# for TAG in "${COMMIT_TAGS[@]}"; do
# echo "${TAG}"
# done
alias_tags=("${COMMIT_TAGS[@]}")
else
alias_tags=("${BUILD_TAGS[@]}")
fi
echo "Generated the following build tags: "
echo "Generated the following tags: "
for TAG in "${alias_tags[@]}"; do
echo "${TAG}"
done
Expand Down

0 comments on commit 8e02b2f

Please sign in to comment.