-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from kickingvegas/merge-development-to-main-20…
…240313_103936 Merge development to main 20240313_103936
- Loading branch information
Showing
7 changed files
with
185 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
## | ||
# Copyright 2024 Charles Y. Choi | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
|
||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
## Requirements | ||
# - Python 3.11+ | ||
# - GNU awk 5.3+ | ||
# - Python semver | ||
# - Bash | ||
|
||
CASUAL_EL=casual.el | ||
|
||
TIMESTAMP := $(shell /bin/date "+%Y%m%d_%H%M%S") | ||
CASUAL_VERSION := $(shell ./scripts/read-version.sh $(CASUAL_EL)) | ||
# BUMP_LEVEL: major|minor|patch|prerelease|build | ||
BUMP_LEVEL=patch | ||
CASUAL_VERSION_BUMP := $(shell python -m semver bump $(BUMP_LEVEL) $(CASUAL_VERSION)) | ||
|
||
.PHONY: tests \ | ||
create-pr \ | ||
bump \ | ||
checkout-development \ | ||
checkout-main \ | ||
sync-development-with-main \ | ||
create-merge-development-branch \ | ||
create-pr \ | ||
create-release-pr \ | ||
create-release-tag | ||
|
||
|
||
## Run test regression | ||
tests: | ||
$(MAKE) -C tests tests | ||
|
||
## Bump Patch Version | ||
bump: checkout-development | ||
sed -i 's/;; Version: $(CASUAL_VERSION)/;; Version: $(CASUAL_VERSION_BUMP)/' $(CASUAL_EL) | ||
git commit -m 'Bump version to $(CASUAL_VERSION_BUMP)' $(CASUAL_EL) | ||
git push | ||
|
||
checkout-development: | ||
git checkout development | ||
git branch --set-upstream-to=origin/development development | ||
git fetch origin --prune | ||
git pull | ||
|
||
checkout-main: | ||
git checkout main | ||
git branch --set-upstream-to=origin/main main | ||
git fetch origin --prune | ||
git pull | ||
|
||
sync-development-with-main: checkout-main checkout-development | ||
git merge main | ||
|
||
create-merge-development-branch: checkout-development | ||
git checkout -b merge-development-to-main-$(TIMESTAMP) | ||
git push --set-upstream origin merge-development-to-main-$(TIMESTAMP) | ||
|
||
## Create GitHub pull request for development | ||
create-pr: | ||
gh pr create --base development --fill | ||
|
||
## Create GitHub pull request for release | ||
create-release-pr: create-merge-development-branch bump | ||
gh pr create --base main \ | ||
--title "Merge development to main $(TIMESTAMP)" \ | ||
--fill-verbose | ||
|
||
create-release-tag: checkout-main | ||
git tag $(CASUAL_VERSION) | ||
git push origin $(CASUAL_VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.