Skip to content

Commit

Permalink
make: Create make release command to tag and update mapic-release
Browse files Browse the repository at this point in the history
… branch (#123)

* makefile: Create release command with input check

* makefile: Actually tag && push the new version

* makefile: Do it on a test branch

* makefile: Fix mapic-release fast-forward command

Must run it from the destination branch, so added a
confirmation before changing user current branch.

* makefile: Move back to the real branch
  • Loading branch information
victorges authored Jan 4, 2022
1 parent fce8857 commit a6cfc12
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,22 @@ localdocker:
.PHONY: stream-monitor
monitor:
go build -ldflags="$(ldflags)" cmd/stream-monitor/stream-monitor.go

.PHONY: release
release:
@if [[ ! "$(version)" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-.+)?$$ ]]; then \
echo "Must provide semantic version as arg to make." ; \
echo "e.g. make release version=1.2.3-beta" ; \
exit 1 ; \
fi
@git diff --quiet || { echo "Git working directory is dirty."; exit 1 ; }

git tag -a v$(version) -m "Release v$(version)"
git push origin v$(version)

@echo -n "Release mist-api-connector? [y] "
@read ans && [ $${ans:-y} = y ] || { echo "Mapic release aborted, branch not fast-forwarded."; exit 1 ; }

git checkout mapic-release
git merge --ff-only v$(version)
git push origin mapic-release

0 comments on commit a6cfc12

Please sign in to comment.