From 194a2012569915fd53725064b7935297ba25740a Mon Sep 17 00:00:00 2001 From: thde Date: Tue, 22 Oct 2024 15:53:12 +0200 Subject: [PATCH] build: read version from git or env --- VERSION | 1 - netbox-client-ruby.gemspec | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 VERSION diff --git a/VERSION b/VERSION deleted file mode 100644 index 78bc1ab..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.10.0 diff --git a/netbox-client-ruby.gemspec b/netbox-client-ruby.gemspec index 72e5a3b..37b75df 100644 --- a/netbox-client-ruby.gemspec +++ b/netbox-client-ruby.gemspec @@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| spec.name = 'netbox-client-ruby' - spec.version = File.read(File.expand_path('VERSION', __dir__)).strip + spec.version = (ENV["GITHUB_REF_NAME"] || `git describe --tags --match="v[0-9]*" --abbrev=0`).strip.delete_prefix("v") spec.summary = 'A read/write client for Netbox v2.' spec.homepage = 'https://github.com/ninech/netbox-client-ruby'