auto-download vendor bundles from selected repositories on release-package building.

This commit is contained in:
supermerill 2025-10-16 17:06:23 +02:00
parent 752153d449
commit dd03e7caad
7 changed files with 65 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View 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)

View file

@ -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@

View file

@ -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