Skip to content

Commit

Permalink
Merge branch 'merill-merge'
Browse files Browse the repository at this point in the history
  • Loading branch information
remi durand committed May 26, 2021
2 parents 824b45d + ebbd2f7 commit 27c6242
Show file tree
Hide file tree
Showing 23 changed files with 16,458 additions and 27,041 deletions.
93 changes: 93 additions & 0 deletions create_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import os
from shutil import rmtree
from urllib.request import Request, urlopen, urlretrieve
import json
try:
import requests
except ImportError:
print("you need to do 'python -m pip install requests'");
exit(0);
import zipfile
import io
import time
from datetime import date
import tarfile
import subprocess

repo = "slic3r/slic3r"
program_name = "Slic3r"
path_7zip = r"C:\Program Files\7-Zip\7z.exe"
github_auth_token = "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"

def get_version():
settings_stream = open("./version.inc", mode="r", encoding="utf-8");
lines = settings_stream.read().splitlines();
for line in lines:
if("SLIC3R_VERSION_FULL" in line):
elems = line.split("\"");
return elems[1];
return "";


date_str = date.today().strftime('%y%m%d');
version = get_version();
print("create release for: " + str(version));
release_path = "./release_"+str(version);
if(os.path.isdir(release_path)):
rmtree(release_path);
print("deleting old directory");
os.mkdir(release_path);
#urllib.urlretrieve ("https://api.github.com/repos/"+repo+"/actions/artifacts", release_path+"artifacts.json");
with urlopen("https://api.github.com/repos/"+repo+"/actions/artifacts") as f:
artifacts = json.loads(f.read().decode('utf-8'));
found_win = False;
found_linux = False;
found_linux_appimage = False;
found_macos = False;
print("there is "+ str(artifacts["total_count"])+ " artifacts in the repo");
for entry in artifacts["artifacts"]:
if entry["name"] == "nightly_win64" and not found_win:
found_win = True;
print("ask for: "+entry["archive_download_url"]);
resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
print("win: " +str(resp));
z = zipfile.ZipFile(io.BytesIO(resp.content))
base_name = release_path+"/"+program_name+"_"+version+"_win64_"+date_str;
z.extractall(base_name);
try:
ret = subprocess.check_output([path_7zip, "a", "-tzip", base_name+".zip", base_name]);
except:
print("Failed to zip the win directory, do it yourself");
if entry["name"] == "nightly_macos.dmg" and not found_macos:
found_macos = True;
print("ask for: "+entry["archive_download_url"]);
resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
print("macos: " +str(resp));
z = zipfile.ZipFile(io.BytesIO(resp.content));
z.extractall(release_path);
os.rename(release_path+"/"+program_name+".dmg", release_path+"/"+program_name+"_"+version+"_macos_"+date_str+".dmg");
if entry["name"] == program_name+"-AppImage.tar" and not found_linux_appimage:
found_linux_appimage = True;
print("ask for: "+entry["archive_download_url"]);
resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
print("appimage: " +str(resp));
z = zipfile.ZipFile(io.BytesIO(resp.content));
z.extractall(release_path);
my_tar = tarfile.open(release_path+"/"+program_name+"_ubu64.AppImage.tar");
my_tar.extractall(release_path);
my_tar.close();
os.rename(release_path+"/"+program_name+"_ubu64.AppImage", release_path+"/"+program_name+"-ubuntu_18.04-" + version + ".AppImage");
if entry["name"] == "nightly_linux.tar" and not found_linux:
found_linux = True;
print("ask for: "+entry["archive_download_url"]);
resp = requests.get(entry["archive_download_url"], headers={'Authorization': 'token ' + github_auth_token,}, allow_redirects=True);
print("appimage: " +str(resp));
z = zipfile.ZipFile(io.BytesIO(resp.content));
z.extractall(release_path);
base_path = release_path+"/"+program_name+"_" + version + "_linux64_" + date_str;
os.rename(release_path+"/"+program_name+".tar", base_path+".tar");
try:
subprocess.check_output([path_7zip, "a", "-tzip", base_path+".tar.zip", base_path+".tar"]);
except:
with zipfile.ZipFile(base_path+"_bof.tar.zip", 'w') as myzip:
myzip.write(base_path+".tar");
16 changes: 15 additions & 1 deletion resources/localization/cs/Slic3r.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@

# Translation file for czech
# Copyright (C) 2021
# This file is distributed under the same license as Slic3r.
#
msgid ""
msgstr ""
"Project-Id-Version: Slic3r\n"
"POT-Creation-Date: 2021-05-26 00:00+0200\n"
"PO-Revision-Date: 2021-05-26 00:00+0200\n"
"Last-Translator: Prusa\n"
"Language-Team:\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"

#: src/slic3r/GUI/AboutDialog.cpp:45 src/slic3r/GUI/AboutDialog.cpp:310
msgid "Portions copyright"
Expand Down
16 changes: 15 additions & 1 deletion resources/localization/de/Slic3r.po
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@

# Translation file for deutch
# Copyright (C) 2021
# This file is distributed under the same license as Slic3r.
#
msgid ""
msgstr ""
"Project-Id-Version: Slic3r\n"
"POT-Creation-Date: 2021-05-26 00:00+0200\n"
"PO-Revision-Date: 2021-05-26 00:00+0200\n"
"Last-Translator: Prusa\n"
"Language-Team:\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"

#: src/slic3r/GUI/AboutDialog.cpp:45 src/slic3r/GUI/AboutDialog.cpp:310
msgid "Portions copyright"
Expand Down
15 changes: 15 additions & 0 deletions resources/localization/en/Slic3r.po
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Translation file for english
# Copyright (C) 2021
# This file is distributed under the same license as Slic3r.
#
msgid ""
msgstr ""
"Project-Id-Version: Slic3r\n"
"POT-Creation-Date: 2021-05-26 00:00+0200\n"
"PO-Revision-Date: 2021-05-26 00:00+0200\n"
"Last-Translator: Prusa\n"
"Language-Team:\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"


#: src/slic3r/GUI/ButtonsDescription.cpp:16
Expand Down
15 changes: 15 additions & 0 deletions resources/localization/es/Slic3r.po
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Translation file for espagnol
# Copyright (C) 2021
# This file is distributed under the same license as Slic3r.
#
msgid ""
msgstr ""
"Project-Id-Version: Slic3r\n"
"POT-Creation-Date: 2021-05-26 00:00+0200\n"
"PO-Revision-Date: 2021-05-26 00:00+0200\n"
"Last-Translator: Prusa\n"
"Language-Team:\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: es\n"


#: src/slic3r/GUI/AboutDialog.cpp:45 src/slic3r/GUI/AboutDialog.cpp:310
Expand Down
Loading

0 comments on commit 27c6242

Please sign in to comment.