Skip to content

Commit

Permalink
add ldflag with version
Browse files Browse the repository at this point in the history
  • Loading branch information
fr05t1k committed Oct 13, 2021
1 parent ad4b1f3 commit df11394
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Go
on:
push:
branches: [ master ]
tags: ['v*']
pull_request:
branches: [ master ]

Expand All @@ -22,13 +23,13 @@ jobs:
run: go test -v ./...

- name: Build linux amd64
run: GOOS=linux GOARCH=amd64 go build -o ./http-debug-server_linux-amd64 http-debug-server
run: GOOS=linux GOARCH=amd64 go build -ldflags="-X 'main.Version=${GITHUB_REF#refs/*/}'" -o ./http-debug-server_linux-amd64 http-debug-server

- name: Build darwin amd64
run: GOOS=darwin GOARCH=amd64 go build -o ./http-debug-server_darwin-amd64 http-debug-server
run: GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'main.Version=${GITHUB_REF#refs/*/}'" -o ./http-debug-server_darwin-amd64 http-debug-server

- name: Build darwin arm64
run: GOOS=darwin GOARCH=arm64 go build -o ./http-debug-server_darwin-arm64 http-debug-server
run: GOOS=darwin GOARCH=arm64 go build -ldflags="-X 'main.Version=${GITHUB_REF#refs/*/}'" -o ./http-debug-server_darwin-arm64 http-debug-server

- name: Upload http-debug-server_linux-amd64
uses: actions/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion http-debug-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import (
"github.com/urfave/cli"
)

var Version = "dev"

func main() {
app := cli.NewApp()
app.Version = "0.9.0"
app.Version = Version
app.Description = "The application provide ability to debug HTTP requests"
app.Usage = "HTTP Debug"

Expand Down

0 comments on commit df11394

Please sign in to comment.