-
Notifications
You must be signed in to change notification settings - Fork 9
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 #27 from kyxap/main
Sync @kyxap fork after receiving maintainer role
- Loading branch information
Showing
29 changed files
with
332 additions
and
383 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 |
---|---|---|
|
@@ -140,3 +140,7 @@ dmypy.json | |
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# Release | ||
release | ||
*.bak |
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 |
---|---|---|
@@ -1,14 +1,55 @@ | ||
version = 0.5.2-beta | ||
zip_file = releases/KOReader Sync v$(version).zip | ||
zip_contents = about.txt LICENSE plugin-import-name-koreader.txt *.py *.md images/*.png | ||
# Read the version from the version.txt file | ||
version := $(shell head -n 1 version.txt) | ||
zip_file = KOReader_Sync_v$(version).zip | ||
zip_contents = about.txt LICENSE plugin-import-name-koreader.txt *.py *.md images/*.png | ||
plugin_index_file_to_upd = pluginIndexKOReaderSync.txt | ||
init_file_to_upd = __init__.py | ||
release_dir = release | ||
|
||
all: zip | ||
# Convert the version to tuple format | ||
version_tuple := $(shell echo $(version) | awk -F. '{print "("$$1", "$$2", "$$3")"}') | ||
|
||
zip: | ||
@ echo "creating new $(zip_file)" && zip "$(zip_file)" $(zip_contents) && echo "created new $(zip_file)" | ||
# Main targets | ||
release: update_version zip load | ||
|
||
zip: $(release_dir) | ||
@echo "Creating new $(release_dir)/$(zip_file)" && zip "$(release_dir)/$(zip_file)" $(zip_contents) && echo "Created new $(release_dir)/$(zip_file)" | ||
|
||
# Loads current src content, use this if doing dev changes | ||
dev: | ||
@ calibre-customize -b .; calibre-debug -g | ||
@calibre-customize -b .; calibre-debug -g | ||
|
||
# Loads zip from release dir if exists | ||
load: | ||
@ calibre-customize -a "$(zip_file)"; calibre-debug -g | ||
@calibre-customize -a "$(release_dir)/$(zip_file)"; calibre-debug -g | ||
|
||
update_version: update_version_plugin_index update_version_init | ||
@echo "Versions updated in all files." | ||
|
||
update_version_plugin_index: | ||
@echo "Updating version in $(plugin_index_file_to_upd) to $(version)" | ||
@sed -i 's/Version: [^;]*;/Version: $(version);/' $(plugin_index_file_to_upd) | ||
@echo "Version updated in $(plugin_index_file_to_upd)" | ||
|
||
update_version_init: | ||
@echo "Updating version in $(init_file_to_upd) to $(version_tuple)" | ||
@sed -i '/^[[:space:]]*version = /s/version = ([0-9, ]*)/version = $(version_tuple)/' $(init_file_to_upd) | ||
@echo "Version updated in $(init_file_to_upd)" | ||
|
||
$(release_dir): | ||
@mkdir -p $(release_dir) | ||
@echo "Created $(release_dir) directory" | ||
|
||
debug_version: | ||
@echo "Read version: $(version)" | ||
@echo "Version tuple: $(version_tuple)" | ||
|
||
tag: | ||
@echo "Tagging version v$(version) and pushing to the repository" | ||
@if git rev-parse "v$(version)" >/dev/null 2>&1; then \ | ||
echo "Tag v$(version) already exists. Deleting the old tag."; \ | ||
git tag -d "v$(version)"; \ | ||
git push origin ":refs/tags/v$(version)"; \ | ||
fi | ||
@git tag -a "v$(version)" -m "Version $(version)" # Create annotated tag for the version | ||
@git push origin "v$(version)" # Push the tag to the remote repository |
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.