Skip to content

Commit

Permalink
ci: cleanup prepare script
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Oct 16, 2024
1 parent 7a9e12c commit 8a0f312
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/logql-analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,29 @@ jobs:
MAJOR_MINOR_VERSION_REGEXP: '([0-9]+\\.[0-9]+)'
RELEASE_TAG_REGEXP: '^([0-9]+\\.[0-9]+\\.[0-9]+)$'
run: |
echo "$(./tools/image-tag)" > .tag
version="${RELEASE_VERSION}"
if [[ "${version}" == "test" ]]; then
echo "RELEASE_VERSION is not set, using image tag"
version=$(cat .tag)
fi
echo "RELEASE_VERSION: $version"
version() {
local version="${RELEASE_VERSION}"
if [[ "${version}" == "test" ]]; then
echo "RELEASE_VERSION is not set, using image tag"
version=$(cat .tag)
fi
echo "${version}"
}
release_name() {
local version=$1
# if the tag matches the pattern `D.D.D` then RELEASE_NAME="D-D-x", otherwise RELEASE_NAME="next"
local release_name
release_name=$([[ ${version} =~ $RELEASE_TAG_REGEXP ]] && echo $RELEASE_TAG | grep -oE $MAJOR_MINOR_VERSION_REGEXP | sed "s/\\./-/g" | sed "s/$/-x/" || echo "next")
# if the tag matches the pattern `D.D.D` then RELEASE_NAME="D-D-x", otherwise RELEASE_NAME="next"
RELEASE_NAME=$([[ $version =~ $RELEASE_TAG_REGEXP ]] && echo $RELEASE_TAG | grep -oE $MAJOR_MINOR_VERSION_REGEXP | sed "s/\\./-/g" | sed "s/$/-x/" || echo "next")
echo "RELEASE_NAME: $RELEASE_NAME"
echo "${release_name}"
}
echo "$(./tools/image-tag)" > .tag
version="$(version)"
echo "release_version=${version}" >> "$GITHUB_OUTPUT"
echo "release_name=${RELEASE_NAME}" >> "$GITHUB_OUTPUT"
echo "release_name=$(release_name ${version})" >> "$GITHUB_OUTPUT"
- id: "get-github-app-token"
name: "get github app token"
Expand Down

0 comments on commit 8a0f312

Please sign in to comment.