Skip to content

Commit 92bb1cd

Browse files
ekohlevgeni
authored andcommitted
Derive the version from git tags
Rather than copying the version and keeping them in sync, this uses git describe to determine that. It still delivers the version in a VERSION file by letting git replace the version on export.
1 parent d60a04b commit 92bb1cd

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VERSION export-subst

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME := foremanctl
2-
VERSION := $(shell cat VERSION)
2+
VERSION := $(shell git describe)
33
REQUIREMENTS_YML := $(firstword $(wildcard src/requirements-lock.yml src/requirements.yml))
44

55
dist: $(NAME)-$(VERSION).tar.gz

RELEASE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Release
22

3-
To create a release, bump `VERSION`, create a commit and tag.
3+
To create a release, create a tag.
44
It must follow the x.y.z pattern without any prefix.
55

66
```
77
VERSION=x.y.z
8-
echo $VERSION > VERSION
9-
git commit -m "Release $VERSION" VERSION
108
git tag -s "$VERSION" -m "Release $VERSION"
119
git push --follow-tags
1210
```

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
$Format:%(describe)$

0 commit comments

Comments
 (0)