From 3ba15c5ba322eec915dfacc357883663aabb0cca Mon Sep 17 00:00:00 2001 From: thde Date: Tue, 22 Oct 2024 15:58:13 +0200 Subject: [PATCH] build: read version from git or env --- .github/workflows/rspec.yml | 2 ++ VERSION | 1 - netbox-client-ruby.gemspec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 VERSION diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 0f4cfbf..4f54887 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -36,6 +36,8 @@ jobs: BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }} steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} 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..19bca69 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 = `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'