Skip to content

Commit

Permalink
workflow: fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Dec 28, 2024
1 parent d51d419 commit 3bdfb7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
path: internal/embed/frontend
- name: Set build info
run: |
echo "VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo '0.0.0')" >> $GITHUB_ENV
echo "VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo '0.0.0')" >> $GITHUB_ENV
echo "BUILD_TIME=$(date -u '+%F %T UTC')" >> $GITHUB_ENV
echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "GO_VERSION=$(go version | cut -d' ' -f3)" >> $GITHUB_ENV
Expand Down
7 changes: 7 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ builds:
- arm64
ldflags:
- -s -w --extldflags "-static"
- -X 'github.com/TheTNB/panel/internal/app.Version={{ .Version }}'
- -X 'github.com/TheTNB/panel/internal/app.BuildTime={{ .Now.Format "2006-01-02 15:04:05 MST" }}'
- -X 'github.com/TheTNB/panel/internal/app.CommitHash={{ .ShortCommit }}'
- -X 'github.com/TheTNB/panel/internal/app.GoVersion={{ .Env.GOVERSION }}'
- -X 'github.com/TheTNB/panel/internal/app.BuildID={{ .Env.GITHUB_RUN_ID }}'
- -X 'github.com/TheTNB/panel/internal/app.BuildUser={{ .Env.USER }}'
- -X 'github.com/TheTNB/panel/internal/app.BuildHost={{ .Env.HOSTNAME }}'

upx:
- enabled: true
Expand Down

0 comments on commit 3bdfb7f

Please sign in to comment.