Skip to content

Commit f5c97a8

Browse files
committed
build: read version from git or env
1 parent c12924a commit f5c97a8

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/rspec.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
3737
steps:
3838
- uses: actions/checkout@v2
39+
with:
40+
fetch-depth: 0
3941
- uses: ruby/setup-ruby@v1
4042
with:
4143
ruby-version: ${{ matrix.ruby }}

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

netbox-client-ruby.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
33

44
Gem::Specification.new do |spec|
55
spec.name = 'netbox-client-ruby'
6-
spec.version = File.read(File.expand_path('VERSION', __dir__)).strip
6+
spec.version = `git describe --tags --match="v[0-9]*" --abbrev=0`.strip.delete_prefix("v")
77

88
spec.summary = 'A read/write client for Netbox v2.'
99
spec.homepage = 'https://github.com/ninech/netbox-client-ruby'

0 commit comments

Comments
 (0)