Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: consolidate tags to fedora-version #7

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ 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

Expand All @@ -122,30 +123,28 @@ jobs:
tag="${{ env.kernel_release }}"
short_tag=$(echo ${{ env.kernel_major_minor_patch }} | cut -d "-" -f 1)
COMMIT_TAGS=()
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+=("${{ matrix.fedora_version }}")
BUILD_TAGS+=(${{ matrix.fedora_version }}-${short_tag})
BUILD_TAGS+=(${tag})
if [[ ${{ matrix.kernel_flavor }} =~ main|coreos-stable|surface ]]; then
BUILD_TAGS+=("${{ matrix.fedora_version }}-latest")
BUILD_TAGS+=(${{ matrix.fedora_version }}-${short_tag})
else
BUILD_TAGS+=("latest")
BUILD_TAGS+=(${short_tag})
fi
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