Skip to content

Commit

Permalink
add version to release binary
Browse files Browse the repository at this point in the history
lesomnus committed Nov 25, 2024
1 parent 08f20c6 commit e2add01
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ RUN --mount=type=secret,id=github_token,env=GH_TOKEN \
&& curl -sSL "https://github.com/cli/cli/releases/download/v2.62.0/gh_2.62.0_linux_$TARGETARCH.tar.gz" -o ./gh.tar.gz \
&& tar -xf ./gh.tar.gz \
&& mv ./gh_*/bin/gh ./gh \
&& BRING_NAME="./bring-linux-$TARGETARCH" \
&& BRING_NAME="./bring-$VERSION_NAME-linux-$TARGETARCH" \
&& cp ./bring "$BRING_NAME" \
&& ./gh version \
&& ./gh auth status \
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ func NewCmdVersion() *cli.Command {
b := strings.Builder{}
b.WriteString(fmt.Sprintf("BRING_VERSION=%s\n", _buildInfo.Version))
b.WriteString(fmt.Sprintf("BRING_TIME_BUILD=%s\n", _buildInfo.TimeBuild))
b.WriteString(fmt.Sprintf("BUILD_GIT_REV=%s", _buildInfo.GitRev))
b.WriteString(fmt.Sprintf("BRING_GIT_REV=%s", _buildInfo.GitRev))
if _buildInfo.GitDirty {
b.WriteString("-dirty")
}
2 changes: 1 addition & 1 deletion scripts/gen-version-file.sh
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Directory where this scr
__root="$(cd "$(dirname "${__dir}")" && pwd)" # Root directory of project.

BRING_VERSION=${BRING_VERSION:-"v0.0.0-test"}
TIME_BUILD=$(date --rfc-3339=seconds)
TIME_BUILD=$(date -u "+%Y-%m-%dT%H:%M:%SZ")
GIT_REV=$(git rev-parse HEAD)
GIT_DIRTY=$(git status --porcelain | read -t 0 && echo "true" || echo "false")

0 comments on commit e2add01

Please sign in to comment.