File tree 5 files changed +12
-6
lines changed
5 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 95
95
linux/amd64
96
96
linux/arm64
97
97
file : ${{ matrix.dockerfile }}
98
+ build-args : |
99
+ VERSION=${{ github.ref_name }}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ builds:
13
13
- amd64
14
14
- arm64
15
15
ldflags :
16
- - -s -w -X main.build ={{.Version}}
16
+ - -s -w -X main.version ={{.Version}}
17
17
18
18
archives :
19
19
- format : zip
Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ RUN go mod download
8
8
9
9
COPY . /app/
10
10
11
- RUN CGO_ENABLED=1 go build -ldflags="-s -w -linkmode external -extldflags \" -static\" " -o portrd ./cmd/portrd
11
+ ARG VERSION=dev
12
+
13
+ RUN CGO_ENABLED=1 go build -ldflags="-s -w -linkmode external -extldflags \" -static\" -X main.version=${VERSION}" -o portrd ./cmd/portrd
12
14
13
15
FROM alpine:3.20 AS final
14
16
Original file line number Diff line number Diff line change @@ -10,13 +10,14 @@ import (
10
10
"github.com/urfave/cli/v2"
11
11
)
12
12
13
- const VERSION = "0.0.29-beta"
13
+ // Set at build time
14
+ var version = "0.0.0"
14
15
15
16
func main () {
16
17
app := & cli.App {
17
18
Name : "portr" ,
18
19
Usage : "Expose local ports to the public internet" ,
19
- Version : VERSION ,
20
+ Version : version ,
20
21
Flags : []cli.Flag {
21
22
& cli.StringFlag {
22
23
Name : "config" ,
Original file line number Diff line number Diff line change @@ -16,13 +16,14 @@ import (
16
16
"github.com/urfave/cli/v2"
17
17
)
18
18
19
- const VERSION = "0.0.29-beta"
19
+ // Set at build time
20
+ var version = "0.0.0"
20
21
21
22
func main () {
22
23
app := & cli.App {
23
24
Name : "portrd" ,
24
25
Usage : "portr server" ,
25
- Version : VERSION ,
26
+ Version : version ,
26
27
Commands : []* cli.Command {
27
28
{
28
29
Name : "start" ,
You can’t perform that action at this time.
0 commit comments