-
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.
- Loading branch information
Showing
7 changed files
with
95 additions
and
82 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
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,32 +1,31 @@ | ||
from typing import Optional | ||
|
||
from build_config import Github, Translations | ||
from translations.loc import LOC | ||
|
||
from .tools.builder import Builder | ||
from .tools.publisher import Publisher | ||
from .tools.templater import Templater | ||
from .tools.utils.protocols import CfgBuild, CfgEnvironments, CfgTemplate, CfgTemplates | ||
from .tools.release import ReleaseCreator | ||
from .tools.templater import Templater, get_template_by_name | ||
from .tools.utils.protocols import CfgBuild, CfgEnvironments, CfgTemplates | ||
|
||
|
||
def do_build( | ||
build: CfgBuild, | ||
environments: CfgEnvironments, | ||
templates: CfgTemplates, | ||
readme: CfgTemplate, | ||
publisher: Optional[Publisher] = None, | ||
publish: bool = False, | ||
) -> None: | ||
LOC.set_tranlastions(Translations.path) | ||
release = ReleaseCreator(build, environments, Github) | ||
publisher = Publisher(build, environments, Github, release) if publish else None | ||
if Builder(build, environments, LOC, publisher).build_all(): | ||
Templater(build, environments, Github).create_all(templates) | ||
Templater(build, environments, Github, release).create_all(templates) | ||
if publisher: | ||
publisher.show_versions() | ||
else: | ||
Templater(build, environments, Github).create(readme) | ||
elif readme := get_template_by_name(templates, "Readme"): | ||
Templater(build, environments, Github, release).create(readme) | ||
|
||
|
||
if __name__ == "__main__": | ||
import build_config | ||
|
||
PUBLISHER = Publisher(build_config.Build, build_config.Environments, Github) | ||
do_build(build_config.Build, build_config.Environments, build_config.Templates, build_config.Readme, PUBLISHER) | ||
do_build(build_config.Build, build_config.Environments, build_config.Templates, True) |
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
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
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
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
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