Skip to content

Commit fe37cef

Browse files
proper version code (#21)
* proper version code * update pipeline --------- Co-authored-by: Paul Gellai <[email protected]>
1 parent ddbff36 commit fe37cef

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Diff for: .github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
go-version: ">=1.19.7"
4141
-
4242
name: Go Build
43-
run: go build -o ./win-build/ssh-sync.exe
43+
run: go build -o ./win-build/ssh-sync.exe -ldflags "-X main.version=${{github.ref_name}}"
4444
shell: powershell
4545
-
4646
name: Inno Build
@@ -61,7 +61,7 @@ jobs:
6161
with:
6262
go-version: ">=1.19.7"
6363
- name: Go Build
64-
run: go build -o ssh-sync
64+
run: go build -o ssh-sync -ldflags "-X main.version=${{github.ref_name}}"
6565
- name: Upload Artifact
6666
uses: actions/upload-artifact@v3
6767
with:

Diff for: .github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
go-version: ">=1.19.7"
3333
-
3434
name: Go Build
35-
run: go build -o ./win-build/ssh-sync.exe
35+
run: go build -o ./win-build/ssh-sync.exe -ldflags "-X main.version=${{github.ref_name}}"
3636
shell: powershell
3737
-
3838
name: Inno Build
@@ -47,4 +47,4 @@ jobs:
4747
with:
4848
go-version: ">=1.19.7"
4949
- name: Go Build
50-
run: go build -o ssh-sync
50+
run: go build -o ssh-sync -ldflags "-X main.version=${{github.ref_name}}"

Diff for: main.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ import (
88
"github.com/urfave/cli/v2"
99
)
1010

11+
var version string
12+
1113
func main() {
1214
app := &cli.App{
1315
Name: "ssh-sync",
14-
Version: "v0.2.4",
16+
Version: version,
1517
Description: "Syncs your ssh keys to a remote server",
1618
Commands: []*cli.Command{
1719
{

0 commit comments

Comments
 (0)