diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index f67b425..7fcf0b0 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -35,7 +35,7 @@ jobs: if: ${{ runner.os == 'Linux' }} - name: Build for Linux run: >- - sh -c "go build -v -ldflags '-s -w' -o bin/rpcfetch-linux ./fetch && + sh -c "go build -v -ldflags '-s -w -X main.Version=${{ github.ref_name }}' -o bin/rpcfetch-linux ./fetch && sha256sum --tag -b bin/rpcfetch-linux > bin/rpcfetch-linux.sha256" - name: Build for Windows run: >- @@ -43,7 +43,7 @@ jobs: CGO_ENABLED=1 CGO_LDFLAGS='-static-libgcc -static' GOOS=windows GOARCH=amd64 - go build -v -ldflags '-s -w -H=windowsgui' -o bin/rpcfetch.exe ./fetch && + go build -v -ldflags '-s -w -X main.Version=${{ github.ref_name }} -H=windowsgui' -o bin/rpcfetch.exe ./fetch && sha256sum --tag -b bin/rpcfetch.exe > bin/rpcfetch.exe.sha256" - name: Release id: use-go-action diff --git a/fetch/main.go b/fetch/main.go index ddddd7e..5761157 100644 --- a/fetch/main.go +++ b/fetch/main.go @@ -22,6 +22,8 @@ var ( confPath string headless bool dumpConfig bool + + Version = "impure" ) func init() { diff --git a/fetch/ui.go b/fetch/ui.go index d97db01..63be181 100644 --- a/fetch/ui.go +++ b/fetch/ui.go @@ -207,6 +207,7 @@ var ( widget.NewForm( widget.NewFormItem("Replaces", statusReplaces), widget.NewFormItem("Timer", statusTimer), + widget.NewFormItem("Version", widget.NewLabel(Version)), ), widget.NewSeparator(), container.NewHBox( diff --git a/flake.nix b/flake.nix index f524148..8802096 100644 --- a/flake.nix +++ b/flake.nix @@ -25,9 +25,9 @@ clang ] ++ (if stdenv.isLinux then [ (pkgs.writeShellScriptBin "build" '' - go build -v -o /tmp/rpcfetch ./fetch + go build -v -ldflags '-s -w -X main.Version=flake' -o /tmp/rpcfetch ./fetch # wayland support is partially broken at the moment - #go build -v -tags wayland -o /tmp/wl-rpcfetch ./fetch + #go build -v -ldflags '-s -w -X main.Version=flake' -tags wayland -o /tmp/wl-rpcfetch ./fetch '') vulkan-headers libxkbcommon