Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 fixes makefile recipe for hotfix-releases #2650

Merged
merged 2 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ env:

jobs:
deploy:
if: github.event.base_ref == 'refs/heads/master'
name: deploy staging
runs-on: ${{ matrix.os }}
strategy:
Expand Down
22 changes: 13 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -622,16 +622,20 @@ _git_get_repo_orga_name = $(shell git config --get remote.origin.url | \
echo -e "\e[91mcurrent branch is not master branch."; exit 1;\
fi

.create_github_release_url:
define create_github_release_url
# ensure tags are uptodate
@git pull --tags
@echo -e "\e[33mOpen the following link to create the $(if $(findstring -staging, $@),staging,production) release:";
@echo -e "\e[32mhttps://github.com/$(_git_get_repo_orga_name)/releases/new?prerelease=$(if $(findstring -staging, $@),1,0)&target=$(_url_encoded_target)&tag=$(_url_encoded_tag)&title=$(_url_encoded_title)&body=$(_url_encoded_logs)";
@echo -e "\e[33mOr open the following link to create the $(if $(findstring -staging, $@),staging,production) release and paste the logs:";
@echo -e "\e[32mhttps://github.com/$(_git_get_repo_orga_name)/releases/new?prerelease=$(if $(findstring -staging, $@),1,0)&target=$(_url_encoded_target)&tag=$(_url_encoded_tag)&title=$(_url_encoded_title)";
@echo -e "\e[34m$(_prettify_logs)"
git pull --tags && \
echo -e "\e[33mOpen the following link to create the $(if $(findstring -staging, $@),staging,production) release:" && \
echo -e "\e[32mhttps://github.com/$(_git_get_repo_orga_name)/releases/new?prerelease=$(if $(findstring -staging, $@),1,0)&target=$(_url_encoded_target)&tag=$(_url_encoded_tag)&title=$(_url_encoded_title)&body=$(_url_encoded_logs)" && \
echo -e "\e[33mOr open the following link to create the $(if $(findstring -staging, $@),staging,production) release and paste the logs:" && \
echo -e "\e[32mhttps://github.com/$(_git_get_repo_orga_name)/releases/new?prerelease=$(if $(findstring -staging, $@),1,0)&target=$(_url_encoded_target)&tag=$(_url_encoded_tag)&title=$(_url_encoded_title)" && \
echo -e "\e[34m$(_prettify_logs)"
endef

.PHONY: release-staging release-prod
release-staging release-prod: .check-on-master-branch .create_github_release_url ## Helper to create a staging or production release in Github (usage: make release-staging name=sprint version=1 git_sha=optional or make release-prod version=1.2.3 git_sha=optional)
release-staging release-prod: .check-on-master-branch ## Helper to create a staging or production release in Github (usage: make release-staging name=sprint version=1 git_sha=optional or make release-prod version=1.2.3 git_sha=optional)
$(create_github_release_url)

.PHONY: release-hotfix release-staging-hotfix
release-hotfix release-staging-hotfix: .create_github_release_url## Helper to create a hotfix release in Github (usage: make release-hotfix version=1.2.4 git_sha=optional or make release-staging-hotfix name=Sprint version=2)
release-hotfix release-staging-hotfix: ## Helper to create a hotfix release in Github (usage: make release-hotfix version=1.2.4 git_sha=optional or make release-staging-hotfix name=Sprint version=2)
$(create_github_release_url)