mirror of
https://github.com/supermerill/SuperSlicer.git
synced 2026-11-26 23:29:04 +00:00
auto-download vendor bundles from selected repositories on release-package building.
This commit is contained in:
parent
752153d449
commit
dd03e7caad
7 changed files with 65 additions and 0 deletions
5
.github/workflows/ccpp_win.yml
vendored
5
.github/workflows/ccpp_win.yml
vendored
|
|
@ -109,6 +109,11 @@ jobs:
|
|||
working-directory: ./build
|
||||
shell: cmd
|
||||
run: xcopy /RCYIE ..\resources package\resources
|
||||
- name: copy profiles from registered github repositories
|
||||
working-directory: ./build
|
||||
shell: cmd
|
||||
run: |
|
||||
python ..\src\platform\download_vendor_bundles.py package/resources
|
||||
- name: copy dll & exe
|
||||
working-directory: ./build
|
||||
shell: cmd
|
||||
|
|
|
|||
5
.github/workflows/ccpp_win_debug.yml
vendored
5
.github/workflows/ccpp_win_debug.yml
vendored
|
|
@ -153,6 +153,11 @@ jobs:
|
|||
working-directory: ./build
|
||||
shell: cmd
|
||||
run: xcopy /RCYIE ..\resources package\resources
|
||||
- name: copy profiles from registered github repositories
|
||||
working-directory: ./build
|
||||
shell: cmd
|
||||
run: |
|
||||
python ..\src\platform\download_vendor_bundles.py package/resources
|
||||
- name: copy dll & exe
|
||||
working-directory: ./build
|
||||
shell: cmd
|
||||
|
|
|
|||
5
.github/workflows/ccpp_win_rc.yml
vendored
5
.github/workflows/ccpp_win_rc.yml
vendored
|
|
@ -109,6 +109,11 @@ jobs:
|
|||
run: |
|
||||
xcopy /RCYIE ..\resources package\resources
|
||||
del /S /Q package\resources\localization\*.so
|
||||
- name: copy profiles from registered github repositories
|
||||
working-directory: ./build
|
||||
shell: cmd
|
||||
run: |
|
||||
python ..\src\platform\download_vendor_bundles.py package/resources
|
||||
- name: copy dll & exe
|
||||
working-directory: ./build
|
||||
shell: cmd
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
@REM /|/
|
||||
@REM /|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
|
||||
@REM /|/
|
||||
@ECHO WARNING: this script was made for PrusaSlicer but was never adapted to Slic3r/SuperSlicer. It may not work as expected.
|
||||
@setlocal disableDelayedExpansion enableExtensions
|
||||
@IF "%PS_ECHO_ON%" NEQ "" (echo on) ELSE (echo off)
|
||||
@GOTO :MAIN
|
||||
|
|
|
|||
43
src/platform/download_vendor_bundles.py
Normal file
43
src/platform/download_vendor_bundles.py
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import subprocess
|
||||
import configparser
|
||||
import shutil
|
||||
import os
|
||||
import sys
|
||||
|
||||
all_repositories= [
|
||||
"https://github.com/SuperSlicer-org/Voron-Profile.git",
|
||||
"https://github.com/SuperSlicer-org/Creality-Profile.git",
|
||||
"https://github.com/SuperSlicer-org/PrusaResearch-Profile.git",
|
||||
]
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: python download_vendor_bundles.py out_dir_name")
|
||||
sys.exit(1)
|
||||
|
||||
out_resources = "./"+sys.argv[1]
|
||||
if not os.path.exists(out_resources):
|
||||
print("error, the path "+out_resources+" doesn't exists")
|
||||
sys.exit(1)
|
||||
|
||||
for url in all_repositories:
|
||||
print(f"Cloning {url}...")
|
||||
try:
|
||||
subprocess.run(["git", "clone", url], check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Failed to clone {url}: {e}")
|
||||
repo_name_with_git = os.path.basename(url)
|
||||
repo_name = repo_name_with_git.removesuffix('.git')
|
||||
|
||||
# get id
|
||||
config = configparser.ConfigParser()
|
||||
with open(repo_name+"/description.ini", "r", encoding="utf-8") as f:
|
||||
config.read_file(f)
|
||||
vendor_id = config.get("vendor", "id")
|
||||
print(f"Vendor ID: {vendor_id}")
|
||||
# copy into our resources
|
||||
shutil.copy(repo_name + "/profiles/"+vendor_id+".ini", out_resources+"/profiles/"+vendor_id+".ini");
|
||||
#copy the icon directory
|
||||
if os.path.exists(out_resources+"/profiles/"+vendor_id):
|
||||
shutil.rmtree(out_resources+"/profiles/"+vendor_id)
|
||||
shutil.copytree(repo_name + "/profiles/"+vendor_id, out_resources+"/profiles/"+vendor_id)
|
||||
|
||||
|
|
@ -85,6 +85,9 @@ done
|
|||
find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*.txt" -type f -delete
|
||||
find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "*database.mo" -type f -delete
|
||||
find pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources/localization -name "Slic3r.mo" -type f -delete
|
||||
|
||||
#copy distant profiles
|
||||
python ../src/platform/download_vendor_bundles.py pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/Resources
|
||||
|
||||
# copy bin and do not let it lower case
|
||||
cp -f bin/@SLIC3R_APP_CMD@ pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS/@SLIC3R_APP_KEY@
|
||||
|
|
|
|||
|
|
@ -74,6 +74,9 @@ then
|
|||
find package/resources/localization -name "*.txt" -type f -delete
|
||||
find package/resources/localization -name "*database*" -type f -delete
|
||||
find package/resources/localization -name "Slic3r.mo" -type f -delete
|
||||
|
||||
#copy distant profiles
|
||||
python ../src/platform/download_vendor_bundles.py package/resources
|
||||
|
||||
# copy occtwrapper
|
||||
cp src/OCCTWrapper.so package/bin/OCCTWrapper.so
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue