summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Borg <jakob@kastelo.net>2022-11-25 13:14:06 +0100
committerJakob Borg <jakob@kastelo.net>2022-11-25 13:14:27 +0100
commitd4bcbe9c395d924b8a0486b63415fd73aab1728b (patch)
tree6ac7ae9a71e180569c31e42febe346d44dc6a94c
parent663106ef6e3ee3c3a8d9231137aeccf1ddad6e1b (diff)
Properly set build metadatarelease-buildmetadata
-rw-r--r--.github/workflows/build-syncthing.yaml4
-rw-r--r--build.go7
2 files changed, 10 insertions, 1 deletions
diff --git a/.github/workflows/build-syncthing.yaml b/.github/workflows/build-syncthing.yaml
index 837bfe77e..45fed7db8 100644
--- a/.github/workflows/build-syncthing.yaml
+++ b/.github/workflows/build-syncthing.yaml
@@ -16,6 +16,10 @@ env:
# Avoid hilarious amounts of obscuring log output when running tests.
LOGGER_DISCARD: "1"
+ # Our build metadata
+ BUILD_USER: builder
+ BUILD_HOST: github.syncthing.net
+
# A note on actions and third party code... The actions under actions/ (like
# `uses: actions/checkout`) are maintained by GitHub, and we need to trust
# GitHub to maintain their code and infrastructure or we're in deep shit in
diff --git a/build.go b/build.go
index 872fffa7c..838442bb3 100644
--- a/build.go
+++ b/build.go
@@ -1115,7 +1115,12 @@ func buildStamp() int64 {
return time.Now().Unix()
}
- s, _ := strconv.ParseInt(string(bs), 10, 64)
+ s, err := strconv.ParseInt(string(bs), 10, 64)
+ if err != nil {
+ // Fall back to "now".
+ log.Printf("Failed to parse git output: %q: %v", string(bs), err)
+ return time.Now().Unix()
+ }
return s
}