From 95b8d47345f6b1d07243d8ed3299573fccf6cb4a Mon Sep 17 00:00:00 2001 From: Jarred Wilson Date: Sat, 20 Jul 2024 10:52:11 -0400 Subject: [PATCH] fix:[close #25] Automate Versioning Go build defaults to 'continuous' with an override on tag releases to use the github.ref_name (tag name). --- .github/workflows/release.yml | 2 +- VERSION | 1 - main.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 VERSION diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8552eae..39ce16da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: apt-get install -y libbtrfs-dev libdevmapper-dev libgpgme-dev pkg-config build-essential - name: Build - run: go build -o abrootv2 + run: go build -o abrootv2 -ldflags="-X 'main.Version=${{ github.ref_name }}'" - name: Compress run: tar -czvf abrootv2.tar.gz abrootv2 diff --git a/VERSION b/VERSION deleted file mode 100644 index 38f77a65..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.0.1 diff --git a/main.go b/main.go index 6b1770de..158e4e53 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,7 @@ import ( "github.com/vanilla-os/orchid/cmdr" ) -var Version = "2.0.1" +var Version = "continuous" //go:embed locales/*.yml var fs embed.FS