Skip to content

Commit

Permalink
Updated phony tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Feb 4, 2023
1 parent e5df66c commit 27ce971
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .make/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,59 +32,68 @@ endif
export DISTRIBUTIONS_DIR

.PHONY: diff

diff: ## Show the git diff
$(call print-target)
git diff --exit-code
RES=$$(git status --porcelain) ; if [ -n "$$RES" ]; then echo $$RES && exit 1 ; fi

.PHONY: help
help: ## Show this help message
@egrep -h '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | column -t -c 2 -s ':#'

.PHONY: install-releaser
install-releaser: ## Install the GoReleaser application
@echo "installing GoReleaser..."
@curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh

.PHONY: release
release:: ## Full production release (creates release in Github)
@echo "releasing..."
@test $(github_token)
@export GITHUB_TOKEN=$(github_token) && goreleaser --rm-dist

.PHONY: release-test
release-test: ## Full production test release (everything except deploy)
@echo "creating a release test..."
@goreleaser --skip-publish --rm-dist

.PHONY: release-snap
release-snap: ## Test the full release (build binaries)
@echo "creating a release snapshot..."
@goreleaser --snapshot --skip-publish --rm-dist

.PHONY: release-version
replace-version: ## Replaces the version in HTML/JS (pre-deploy)
@echo "replacing version..."
@test $(version)
@test "$(path)"
@find $(path) -name "*.html" -type f -exec sed -i '' -e "s/{{version}}/$(version)/g" {} \;
@find $(path) -name "*.js" -type f -exec sed -i '' -e "s/{{version}}/$(version)/g" {} \;

.PHONY: tag
tag: ## Generate a new tag and push (tag version=0.0.0)
@echo "creating new tag..."
@test $(version)
@git tag -a v$(version) -m "Pending full release..."
@git push origin v$(version)
@git fetch --tags -f

.PHONY: tag-remove
tag-remove: ## Remove a tag if found (tag-remove version=0.0.0)
@echo "removing tag..."
@test $(version)
@git tag -d v$(version)
@git push --delete origin v$(version)
@git fetch --tags

.PHONY: tag-update
tag-update: ## Update an existing tag to current commit (tag-update version=0.0.0)
@echo "updating tag to new commit..."
@test $(version)
@git push --force origin HEAD:refs/tags/v$(version)
@git fetch --tags -f

.PHONY: update-releaser
update-releaser: ## Update the goreleaser application
@echo "updating GoReleaser application..."
@$(MAKE) install-releaser

0 comments on commit 27ce971

Please sign in to comment.