mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 09:00:10 +00:00
version based on current tag for makefile
if there isnt a tag, version is 'git'. this fixes versioning for aur package and docker.
This commit is contained in:
parent
500ecac95d
commit
258656fbf9
2
Makefile
2
Makefile
@ -29,7 +29,7 @@ mail:
|
|||||||
python3 mail/generate.py
|
python3 mail/generate.py
|
||||||
|
|
||||||
version:
|
version:
|
||||||
python3 version.py git version.go
|
python3 version.py auto version.go
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
echo "Downloading deps"
|
echo "Downloading deps"
|
||||||
|
@ -6,6 +6,13 @@ try:
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
version = "git"
|
version = "git"
|
||||||
|
|
||||||
|
if version == "auto":
|
||||||
|
try:
|
||||||
|
version = subprocess.check_output("git describe --exact-match HEAD".split()).decode("utf-8").rstrip().replace('v', '')
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
if e.returncode == 128:
|
||||||
|
version = "git"
|
||||||
|
|
||||||
commit = subprocess.check_output("git rev-parse --short HEAD".split()).decode("utf-8").rstrip()
|
commit = subprocess.check_output("git rev-parse --short HEAD".split()).decode("utf-8").rstrip()
|
||||||
|
|
||||||
file = f'package main; const VERSION = "{version}"; const COMMIT = "{commit}";'
|
file = f'package main; const VERSION = "{version}"; const COMMIT = "{commit}";'
|
||||||
|
Loading…
Reference in New Issue
Block a user