From 1f0fcafb8ab6b8ef30c85d0d6e423e36b42a3a8a Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Fri, 22 Oct 2021 17:21:38 +0200 Subject: [PATCH] fix: ensure we bind oohelperd with the repo's version number (#558) Work related to https://github.com/ooni/probe/issues/1506#issuecomment-949715707. This diff cherry-picks from the release/3.11 branch. --- .github/workflows/oohelperd.yml | 6 ++++++ internal/cmd/printversion/main.go | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 internal/cmd/printversion/main.go diff --git a/.github/workflows/oohelperd.yml b/.github/workflows/oohelperd.yml index 9ea1271..cc881f0 100644 --- a/.github/workflows/oohelperd.yml +++ b/.github/workflows/oohelperd.yml @@ -26,6 +26,12 @@ jobs: sudo apt-get install -yq --no-install-recommends curl devscripts \ dpkg-dev debhelper git python3 python3-requests python3-gnupg s3cmd + - name: update the debian changelog + run: | + version="$(go run ./internal/cmd/printversion)~$GITHUB_RUN_NUMBER" + cd ./internal/cmd/oohelperd + dch -v "$version" "New version ${version}" + - name: build deb package run: | cd ./internal/cmd/oohelperd diff --git a/internal/cmd/printversion/main.go b/internal/cmd/printversion/main.go new file mode 100644 index 0000000..f402064 --- /dev/null +++ b/internal/cmd/printversion/main.go @@ -0,0 +1,12 @@ +// Command printversion prints the current version of this repository. +package main + +import ( + "fmt" + + "github.com/ooni/probe-cli/v3/internal/version" +) + +func main() { + fmt.Println(version.Version) +}