File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 65
65
with :
66
66
push : true
67
67
context : .
68
- build-args : COMMITHASH=${{ github.event.workflow_run.head_sha }}
68
+ build-args : |
69
+ COMMITHASH=${{ github.event.workflow_run.head_sha }}
70
+ VERSION=${{ github.event.workflow_run.display_title }}
69
71
platforms : linux/amd64,linux/arm64/v8
70
72
tags : getfider/fider:${{ github.event.workflow_run.display_title }}
71
73
cache-from : type=gha
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ RUN go mod download
17
17
COPY . ./
18
18
19
19
ARG COMMITHASH
20
- RUN COMMITHASH=${COMMITHASH} GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build-server
20
+ ARG VERSION
21
+ RUN COMMITHASH=${COMMITHASH} VERSION=${VERSION} GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build-server
21
22
# ################
22
23
# ## UI Build Step
23
24
# ################
Original file line number Diff line number Diff line change 3
3
# # For more information, refer to https://www.thapaliya.com/en/writings/well-documented-makefiles/
4
4
5
5
LDFLAGS += -X github.com/getfider/fider/app/pkg/env.commithash=${COMMITHASH}
6
+ LDFLAGS += -X github.com/getfider/fider/app/pkg/env.version=${VERSION}
6
7
7
8
8
9
Original file line number Diff line number Diff line change @@ -16,17 +16,22 @@ import (
16
16
)
17
17
18
18
var (
19
- // this value is set by the CI build
19
+ // these values are set by the CI build
20
20
commithash = ""
21
- version = "0.22.0 "
21
+ version = ""
22
22
)
23
23
24
24
func Version () string {
25
+ v := version
26
+ if v == "" {
27
+ v = "dev"
28
+ }
29
+
25
30
if commithash == "" {
26
- return fmt . Sprintf ( "%s-dev" , version )
31
+ return v
27
32
}
28
33
29
- return fmt .Sprintf ("%s-%s" , version , commithash )
34
+ return fmt .Sprintf ("%s-%s" , v , commithash )
30
35
}
31
36
32
37
type config struct {
@@ -49,7 +54,7 @@ type config struct {
49
54
Locale string `env:"LOCALE,default=en"`
50
55
JWTSecret string `env:"JWT_SECRET,required"`
51
56
PostCreationWithTagsEnabled bool `env:"POST_CREATION_WITH_TAGS_ENABLED,default=false"`
52
- Paddle struct {
57
+ Paddle struct {
53
58
IsSandbox bool `env:"PADDLE_SANDBOX,default=false"`
54
59
VendorID string `env:"PADDLE_VENDOR_ID"`
55
60
VendorAuthCode string `env:"PADDLE_VENDOR_AUTHCODE"`
You can’t perform that action at this time.
0 commit comments