Skip to content

Commit a51b80e

Browse files
committed
travis: Expand make version and run on deploy.
Make sure tags are available and the repository isn't shallow (required to generate a valid git-describe output). Signed-off-by: Tim 'mithro' Ansell <[email protected]>
1 parent ddee9db commit a51b80e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ git:
44
depth: false
55

66
before_install:
7-
- git fetch origin --tags
8-
- git describe
7+
- make version
98

109
install:
1110
- make env

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ include third_party/make-env/conda.mk
2222
# Create a version.py file
2323
VERSION_PY = sphinx_verilog_domain/version.py
2424
$(VERSION_PY):
25-
echo "__version__ = '$$(git describe | sed -e's/v\([0-9]\+\)\.\([0-9]\+\)-\([0-9]\+\)-g[0-9a-f]\+/\1.\2.post\3/')'" > $@
25+
@echo "__version__ = '$$(git describe | sed -e's/v\([0-9]\+\)\.\([0-9]\+\)-\([0-9]\+\)-g[0-9a-f]\+/\1.\2.post\3/')'" > $@
2626

2727
.PHONY: $(VERSION_PY)
2828

2929
version:
30-
$(MAKE) $(VERSION_PY)
30+
@if $$(git rev-parse --is-shallow-repository); then git fetch --unshallow; fi
31+
git fetch origin --tags
32+
@$(MAKE) $(VERSION_PY)
33+
@cat $(VERSION_PY)
3134

3235
version-clean:
3336
rm -f $(VERSION_PY)

0 commit comments

Comments
 (0)