Skip to content

Commit

Permalink
Read version from git tag by default
Browse files Browse the repository at this point in the history
This change ensures that the LIB_VERSION and LIB_TAG are
set from the ouput of git describe --tags instead of needing to
be hardcoded. This is only applied if the variables are not
set externally.

Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Aug 9, 2023
1 parent 7161f94 commit 576dce2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

GIT_TAG ?= $(patsubst v%,%,$(shell git describe --tags 2>/dev/null))
GIT_COMMIT ?= $(shell git describe --match="" --dirty --long --always --abbrev=40 2> /dev/null || echo "")

LIB_NAME := libnvidia-container
LIB_VERSION ?= 1.14.0
LIB_TAG ?= rc.3
LIB_VERSION ?= $(word 1,$(subst -, ,$(GIT_TAG)))
LIB_TAG ?= $(subst -,+,$(patsubst $(LIB_VERSION)-%,%,$(GIT_TAG)))

VERSION_PARTS := $(subst ., ,$(LIB_VERSION))
MAJOR := $(word 1,$(VERSION_PARTS))
Expand Down

0 comments on commit 576dce2

Please sign in to comment.