mirror of
https://github.com/cnrancher/kube-explorer.git
synced 2025-04-29 03:33:57 +00:00
23 lines
455 B
Bash
Executable File
23 lines
455 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [[ ${GITHUB_REF} == refs/tags/* ]]; then
|
|
GIT_TAG=${GIT_TAG:-${GITHUB_REF_NAME}}
|
|
fi
|
|
|
|
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
|
|
DIRTY="-dirty"
|
|
fi
|
|
|
|
COMMIT=$(git rev-parse --short HEAD)
|
|
GIT_TAG=${GIT_TAG:-$(git tag -l --contains HEAD | head -n 1)}
|
|
|
|
if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then
|
|
VERSION=$GIT_TAG
|
|
else
|
|
VERSION="${COMMIT}${DIRTY}"
|
|
fi
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
ARCH=$(go env GOHOSTARCH)
|
|
fi
|