Skip to content

Commit d769453

Browse files
committed
adding module building for create-module script
1 parent 4d2fe0d commit d769453

6 files changed

Lines changed: 60 additions & 2 deletions

File tree

.github/workflows/OnRelease.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,29 @@ jobs:
2727
with:
2828
files: "builder-tool/dist/*"
2929
repo-token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
build-create-module:
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: setup Python 3.12
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: 3.12
41+
42+
- name: Update pip
43+
run: python -m pip install --upgrade pip
44+
45+
- name: Install builder tool
46+
run : pip install https://github.com/GamuNetwork/devtools/releases/download/1.5.11/build_tool-1.5.11-py3-none-any.whl
47+
48+
- name: Build
49+
run: cd create-module && python pack.py -pv ${{ github.event.release.tag_name }} --debug
50+
51+
- name: Publish
52+
uses: AButler/upload-release-assets@v3.0
53+
with:
54+
files: "create-module/dist/*"
55+
repo-token: ${{ secrets.GITHUB_TOKEN }}

create-module/pack.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from builderTool import BaseBuilder, PYTHON #this file use the module to build itself
2+
3+
4+
class Builder(BaseBuilder):
5+
def Setup(self):
6+
self.addDirectory('src')
7+
self.addAndReplaceByPackageVersion('pyproject.toml')
8+
self.runCommand(f'{PYTHON} -m pip install --upgrade build')
9+
10+
def Build(self):
11+
self.runCommand(f'{PYTHON} -m build --outdir {self.distDir} .')
12+
13+
14+
BaseBuilder.execute()

create-module/pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "create-module"
7+
version = "{version}"
8+
authors = [
9+
{ name="Antoine Buirey", email="antoine.buirey@gmail.com" }
10+
]
11+
description = "A simple build tool for projects"
12+
readme = "readme.md"
13+
requires-python = ">=3.10"
14+
classifiers = [
15+
"Programming Language :: Python :: 3",
16+
"License :: OSI Approved :: MIT License",
17+
"Operating System :: OS Independent",
18+
]

create-module/requirements.txt

-259 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from datetime import datetime
66
from customTypes import Version, ModuleTypes
77

8-
from gamuLogger import debug, info, error, critical, Printer
8+
from gamuLogger import debug, info, error, critical, Logger, LEVELS
99

1010
def parseModuleNames(module_name: str):
1111
# GamuNetwork/ModuleName -> ModuleName
@@ -73,7 +73,7 @@ def createParser():
7373
args = parser.parse_args()
7474

7575
if args.debug:
76-
Printer().set_level(Printer.LEVELS.DEBUG)
76+
Logger.setLevel("stdout", LEVELS.DEBUG)
7777

7878
module_version = Version.fromString(args.module_version)
7979
module_type = ModuleTypes.fromString(args.module_type)

0 commit comments

Comments
 (0)