diff --git a/Makefile b/Makefile index d734980..4e56452 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,15 @@ clean: rm -rf $(BIN_DIR) $(DIST_DIR) ci-version: - @VERSION=$$(git describe --tags --dirty --always); \ + @if [ -f metadata.json ]; then \ + VERSION=$$(jq -r '.version' metadata.json); \ + else \ + VERSION=$$(git rev-parse --short HEAD); \ + fi; \ + BRANCH=$$(git rev-parse --abbrev-ref HEAD); \ + if [ "$$BRANCH" != "main" ] && [ "$$BRANCH" != "master" ]; then \ + VERSION="dev-$$VERSION-$$BRANCH"; \ + fi; \ echo $$VERSION > $(VERSION_FILE) ci-export: diff --git a/metadata.json b/metadata.json index 6a7fd07..53a8662 100644 --- a/metadata.json +++ b/metadata.json @@ -4,5 +4,6 @@ "author": "Teletype Games", "desc": "It's a simple demo program in Ebitengine", "site": "https://git.teletype.hu/games/ebitenginedemo", - "license": "MIT License" + "license": "MIT License", + "version": "1.0.0" }