Skip to content

Commit 491a726

Browse files
committed
Update static definitions for version and release new version
1 parent 7569934 commit 491a726

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Makefile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan
99

1010
.PHONY: static-code-analysis-baseline
1111
static-code-analysis-baseline: check-symfony vendor ## Generates a baseline for static code analysis with phpstan/phpstan
12-
vendor/bin/phpstan analyze --configuration=phpstan-default.neon.dist --generate-baseline=phpstan-default-baseline.neon --memory-limit=-1
12+
vendor/bin/phpstan analyse --configuration=phpstan-default.neon.dist --generate-baseline=phpstan-default-baseline.neon --memory-limit=-1
1313

1414
.PHONY: tests
1515
tests: vendor
@@ -38,7 +38,7 @@ static: ## Generate Static files by api structure
3838
echo "STATIC #######################"
3939
cd tools/ ; ./update_all.sh ; cd ..
4040
make cssilent
41-
[ -f tools/online-version.php ] && php tools/online-version.php | xargs -I{} git tag -a {} -m "Tagging version {} after static update"
41+
[ -f tools/online-version.php ] && php tools/online-version.php | xargs -I{} sh -c 'git tag -a {} -m "Tagging version {} after static update" || exit 0'
4242

4343
.PHONY: reset
4444
reset: ## Reset git to be read for NextWork
@@ -80,13 +80,18 @@ rpm: ## Build RPM package
8080
rpmdev-bumpspec --comment="Build" --userstring="Vítězslav Dvořák <[email protected]>" flexipeehp.spec
8181
rpmbuild -ba flexipeehp.spec
8282

83+
8384
.PHONY: release
84-
release: ## Release a new version
85-
echo Release v$(nextversion)
86-
dch -v $(nextversion) `git log -1 --pretty=%B | head -n 1`
87-
debuild -i -us -uc -b
88-
git commit -a -m "Release v$(nextversion)"
89-
git tag -a $(nextversion) -m "version $(nextversion)"
85+
release: static ## Update static files, commit, and push with tags
86+
VERSION=$(shell php tools/online-version.php)
87+
@if ! git tag --list | grep -q "^$${VERSION}$$"; then \
88+
git add .; \
89+
git commit -m "Update static definitions for version $${VERSION} and release new version $${VERSION}"; \
90+
git push; \
91+
git push --tags; \
92+
else \
93+
echo "Tag $${VERSION} already exists. Release skipped."; \
94+
fi
9095

9196
.PHONY: dimage
9297
dimage: ## Build Docker image

0 commit comments

Comments
 (0)