-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupload.py
More file actions
59 lines (51 loc) · 1.82 KB
/
upload.py
File metadata and controls
59 lines (51 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# pyright: reportUnknownVariableType=false
# Imports
from beet import ProjectConfig
from stewbeet import JsonDict
from stewbeet.continuous_delivery import load_credentials, upload_to_github, upload_to_modrinth, upload_to_pmc, upload_to_smithed
from stewbeet.utils import get_project_config
from stouputils.io import read_file
# Get credentials and try to find the beet configuration
credentials: dict[str, str] = load_credentials("~/stewbeet/credentials.yml")
cfg: ProjectConfig = get_project_config()
# Constants
SUMMARY: str = """
SimplEnergy is a simple Technology data pack created to add simple energy mechanics in your survival world.
Also, it has been made to help the development of energy data packs by using an energy library as simple as possible.
"""
## Uploads
# Upload to GitHub
github_config: JsonDict = {
"project_name": cfg.name,
"version": cfg.version,
"build_folder": cfg.output,
"endswith": [".zip"]
}
changelog: str = upload_to_github(credentials, github_config)
# Upload to Modrinth
modrinth_config: JsonDict = {
"slug": cfg.id,
"project_name": cfg.name,
"version": cfg.version,
"summary": SUMMARY,
"description_markdown": read_file(f"{cfg.directory}/README.md"),
"dependencies": [
#{"project_id": "QQRRSSTT", "version_id": "IIJJKKLL", "dependency_type": "required"},
],
"version_type": "beta",
"build_folder": cfg.output,
}
upload_to_modrinth(credentials, modrinth_config, changelog)
# Upload to Smithed
smithed_config: JsonDict = {
"project_id": cfg.id,
"project_name": cfg.name,
"version": cfg.version,
}
upload_to_smithed(credentials, smithed_config, changelog)
# Upload to PlanetMinecraft
pmc_config: JsonDict = {
"project_url": "https://www.planetminecraft.com/account/manage/data-packs/5305840/",
"version": cfg.version,
}
upload_to_pmc(pmc_config, changelog)