forked from Teahouse-Studios/akari-bot
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #101 from TopRealm/merge-conflict
Merge conflict
- Loading branch information
Showing
44 changed files
with
1,575 additions
and
3,539 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,32 @@ | ||
import shutil | ||
import os | ||
|
||
if __name__ == "__main__": | ||
os.makedirs('output', exist_ok=True) | ||
shutil.copytree('assets', 'output/assets') | ||
os.makedirs('output/config', exist_ok=True) | ||
shutil.copyfile('config/config.toml.example', 'output/config/config.toml.example') | ||
shutil.copytree('locales', 'output/locales') | ||
shutil.copytree('modules', 'output/modules') | ||
|
||
def remove_py_files(path): | ||
|
||
for root, dirs, files in os.walk(path): | ||
for file in files: | ||
if (file.endswith('.py') or file.endswith('.pyc') or file.endswith( | ||
'.pyo') or file.endswith('.pyd') or file.endswith('.pyw')): | ||
os.remove(os.path.join(root, file)) | ||
|
||
for root, dirs, files in os.walk(path): | ||
for dir in dirs: | ||
if dir == '__pycache__': | ||
shutil.rmtree(os.path.join(root, dir)) | ||
|
||
remove_py_files('output/modules') | ||
|
||
build_paths = ['launcher-build', 'wrapper-build'] | ||
for build_path in build_paths: | ||
if os.path.exists(build_path): | ||
for file in os.listdir(build_path): | ||
if file.endswith('.exe') or file.endswith('.bin') or file.endswith('.app'): | ||
shutil.copyfile(os.path.join(build_path, file), os.path.join('output', file)) |
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,14 @@ | ||
import shutil | ||
import json | ||
import os | ||
|
||
if __name__ == "__main__": | ||
modules_folder_list = os.listdir('modules') | ||
with open('assets/modules_list.json', 'w') as f: | ||
json.dump(modules_folder_list, f) | ||
schedulers_folder_list = os.listdir('schedulers') | ||
with open('assets/schedulers_list.json', 'w') as f: | ||
json.dump(schedulers_folder_list, f) | ||
slash_list = os.listdir('bots/discord/slash') | ||
with open('assets/discord_slash_list.json', 'w') as f: | ||
json.dump(slash_list, f) |
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,72 @@ | ||
name: "Build Nightly x64 Executables (3:00, UTC+8)" | ||
|
||
on: | ||
schedule: | ||
- cron: "00 19 * * *" | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Check-out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' # Version range or exact version of a Python version to use, using SemVer's version range syntax | ||
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified | ||
cache: 'pip' | ||
cache-dependency-path: | | ||
**/requirements*.txt | ||
- name: Install Dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Prepare Build | ||
run: | | ||
python .github/scripts/pre_build.py | ||
- name: Build Launcher Executable | ||
uses: Nuitka/Nuitka-Action@main | ||
with: | ||
nuitka-version: main | ||
script-name: launcher.py | ||
onefile: true | ||
standalone: true | ||
output-dir: launcher-build | ||
include-plugin-directory: | | ||
modules | ||
bots | ||
schedulers | ||
include-package-data: | | ||
oss2 | ||
langconv | ||
aliyunsdkcore | ||
- name: Build Wrapper Executable | ||
uses: Nuitka/Nuitka-Action@main | ||
with: | ||
nuitka-version: main | ||
script-name: bot.py | ||
onefile: true | ||
standalone: true | ||
output-dir: wrapper-build | ||
|
||
- name: Copy Assets | ||
run: | | ||
python .github/scripts/build_copy_files.py | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ runner.os }} Build | ||
path: | | ||
output/** |
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
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
Oops, something went wrong.