mirror of
https://github.com/pcvolkmer/osc-variant.git
synced 2025-10-28 23:42:16 +00:00
build: use semver compatible dev version strings
This commit is contained in:
14
Makefile
14
Makefile
@@ -2,9 +2,13 @@ ifndef VERBOSE
|
|||||||
.SILENT:
|
.SILENT:
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TAG = `git describe --tag 2>/dev/null`
|
GITTAG = $(shell git describe --tag --abbrev=0 2>/dev/null | sed -En 's/v(.*)$$/\1/p')
|
||||||
|
ifeq ($(findstring -, $(GITTAG)), -)
|
||||||
REV = git`git rev-parse HEAD | cut -c1-7`
|
GITDEV = $(shell git describe --tag 2>/dev/null | sed -En 's/v(.*)-([0-9]+)-g([0-9a-f]+)$$/.dev.\2+\3/p')
|
||||||
|
else
|
||||||
|
GITDEV = $(shell git describe --tag 2>/dev/null | sed -En 's/v(.*)-([0-9]+)-g([0-9a-f]+)$$/-dev.\2+\3/p')
|
||||||
|
endif
|
||||||
|
VERSION := "$(GITTAG)$(GITDEV)"
|
||||||
|
|
||||||
package-all: win-package linux-package
|
package-all: win-package linux-package
|
||||||
|
|
||||||
@@ -16,7 +20,7 @@ win-package: win-binary-x86_64
|
|||||||
cp README.md osc-variant/
|
cp README.md osc-variant/
|
||||||
cp LICENSE.txt osc-variant/
|
cp LICENSE.txt osc-variant/
|
||||||
# first try (linux) zip command, then powershell sub command to create ZIP file
|
# first try (linux) zip command, then powershell sub command to create ZIP file
|
||||||
zip osc-variant-$(TAG)_win64.zip osc-variant/* osc-variant/examples/* || powershell Compress-ARCHIVE osc-variant osc-variant-$(TAG)_win64.zip
|
zip osc-variant-$(VERSION)_win64.zip osc-variant/* osc-variant/examples/* || powershell Compress-ARCHIVE osc-variant osc-variant-$(VERSION)_win64.zip
|
||||||
rm -rf osc-variant || true
|
rm -rf osc-variant || true
|
||||||
|
|
||||||
.PHONY: linux-package
|
.PHONY: linux-package
|
||||||
@@ -26,7 +30,7 @@ linux-package: linux-binary-x86_64
|
|||||||
cp -r examples osc-variant/
|
cp -r examples osc-variant/
|
||||||
cp README.md osc-variant/
|
cp README.md osc-variant/
|
||||||
cp LICENSE.txt osc-variant/
|
cp LICENSE.txt osc-variant/
|
||||||
tar -czvf osc-variant-$(TAG)_linux.tar.gz osc-variant/
|
tar -czvf osc-variant-$(VERSION)_linux.tar.gz osc-variant/
|
||||||
rm -rf osc-variant || true
|
rm -rf osc-variant || true
|
||||||
|
|
||||||
binary-all: win-binary-x86_64 linux-binary-x86_64
|
binary-all: win-binary-x86_64 linux-binary-x86_64
|
||||||
|
|||||||
Reference in New Issue
Block a user