rpcfetch: ui: show version in interface
release / release (push) Successful in 15m20s Details

Default fallback value of "impure", the flake build script sets it to "flake", and the gitea action sets it to the tag.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
Ophestra Umiker 2024-06-30 15:37:16 +09:00
parent 44ba51184b
commit 0693bffa4a
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q
4 changed files with 7 additions and 4 deletions

View File

@ -35,7 +35,7 @@ jobs:
if: ${{ runner.os == 'Linux' }} if: ${{ runner.os == 'Linux' }}
- name: Build for Linux - name: Build for Linux
run: >- 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" sha256sum --tag -b bin/rpcfetch-linux > bin/rpcfetch-linux.sha256"
- name: Build for Windows - name: Build for Windows
run: >- run: >-
@ -43,7 +43,7 @@ jobs:
CGO_ENABLED=1 CGO_ENABLED=1
CGO_LDFLAGS='-static-libgcc -static' CGO_LDFLAGS='-static-libgcc -static'
GOOS=windows GOARCH=amd64 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" sha256sum --tag -b bin/rpcfetch.exe > bin/rpcfetch.exe.sha256"
- name: Release - name: Release
id: use-go-action id: use-go-action

View File

@ -22,6 +22,8 @@ var (
confPath string confPath string
headless bool headless bool
dumpConfig bool dumpConfig bool
Version = "impure"
) )
func init() { func init() {

View File

@ -207,6 +207,7 @@ var (
widget.NewForm( widget.NewForm(
widget.NewFormItem("Replaces", statusReplaces), widget.NewFormItem("Replaces", statusReplaces),
widget.NewFormItem("Timer", statusTimer), widget.NewFormItem("Timer", statusTimer),
widget.NewFormItem("Version", widget.NewLabel(Version)),
), ),
widget.NewSeparator(), widget.NewSeparator(),
container.NewHBox( container.NewHBox(

View File

@ -25,9 +25,9 @@
clang clang
] ++ (if stdenv.isLinux then [ ] ++ (if stdenv.isLinux then [
(pkgs.writeShellScriptBin "build" '' (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 # 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 vulkan-headers
libxkbcommon libxkbcommon