Skip to content

Commit

Permalink
feat: Print generated container tags for clearer diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-stone committed Feb 15, 2023
1 parent eac8284 commit 627ef83
Showing 1 changed file with 47 additions and 39 deletions.
86 changes: 47 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,49 +57,57 @@ jobs:
shell: bash
run: |
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
alias_tags=()
# Only perform the follow code when the action is spawned from a Pull Request
container_tags=()
# The following is run when the timer is triggered or a merge/push to main
TIMESTAMP="$(date +%Y%m%d.%H%M)"
container_tags+=("${{ matrix.major_version }}-${{ matrix.driver_version }}")
if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
[[ "${{ matrix.is_stable_version }}" == "true" ]]; then
BRANCH="stable"
elif [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
[[ "${{ matrix.is_stable_version }}" != "true" ]]; then
BRANCH="unstable"
else
BRANCH="oldstable"
fi
container_tags+=("${BRANCH}-${{ matrix.driver_version }}")
if [[ "${{ matrix.is_latest_driver }}" == "true" ]]; then
container_tags+=("${{ matrix.major_version }}-current")
container_tags+=("${BRANCH}-current")
container_tags+=("${BRANCH}")
container_tags+=("${{ matrix.major_version }}")
fi
# Append matching timestamp tags to keep a version history
for TAG in "${container_tags[@]}"; do
container_tags+=("${TAG}-${TIMESTAMP}")
container_tags+=("${TAG}-${TIMESTAMP%.*}")
done
if [[ "${BRANCH}" == "stable" ]] && \
[[ "${{ matrix.is_latest_driver }}" == "true" ]]; then
container_tags+=("${TIMESTAMP}")
container_tags+=("${TIMESTAMP%.*}")
container_tags+=("latest")
fi
echo "Generated the following tags: "
for TAG in "${container_tags[@]}"; do
echo "${TAG}"
done
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
alias_tags+=("pr-${{ github.event.number }}")
alias_tags=("pr-${{ github.event.number }}")
else
# The following is run when the timer is triggered or a merge/push to main
TIMESTAMP="$(date +%Y%m%d.%H%M)"
alias_tags+=("${{ matrix.major_version }}-{{ matrix.driver_version }}")
if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
[[ "${{ matrix.is_stable_version }}" == "true" ]]; then
BRANCH="stable"
elif [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
[[ "${{ matrix.is_stable_version }}" != "true" ]]; then
BRANCH="unstable"
else
BRANCH="oldstable"
fi
alias_tags+=("${BRANCH}-{{ matrix.driver_version }}")
if [[ "${{ matrix.is_latest_driver }}" == "true" ]]; then
alias_tags+=("${{ matrix.major_version }}-current")
alias_tags+=("${BRANCH}-current")
alias_tags+=("${BRANCH}")
alias_tags+=("{{ matrix.major_version }}")
fi
# Append matching timestamp tags to keep a version history
for tag in "${alias_tags[@]}"; do
alias_tags+=("${tag}-${TIMESTAMP}")
alias_tags+=("${tag}-${TIMESTAMP%.*}")
done
if [[ "${BRANCH}" == "stable" ]] && \
[[ "${{ matrix.is_latest_driver }}" == "true" ]]; then
alias_tags+=("${TIMESTAMP}")
alias_tags+=("${TIMESTAMP%.*}")
alias_tags+=("latest")
fi
alias_tags=("${container_tags[@]}")
fi
echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT
- name: Retrieve akmods signing key
Expand Down

0 comments on commit 627ef83

Please sign in to comment.