From 9d02301b2dc517ae93d9141a6421cf7f7fb4902d Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 15 Sep 2024 08:57:53 -0300 Subject: [PATCH] support --version using -X --- .github/workflows/release-cli.yml | 1 + main.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index f5c90a8..a515176 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -40,6 +40,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }} + ldflags: -X main.version=${{ github.ref }} overwrite: true md5sum: false sha256sum: false diff --git a/main.go b/main.go index 9e236da..218e5f2 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,8 @@ import ( "github.com/fiatjaf/cli/v3" ) +var version string = "debug" + var app = &cli.Command{ Name: "nak", Suggest: true, @@ -27,6 +29,7 @@ var app = &cli.Command{ bunker, serve, }, + Version: version, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "quiet",