Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openshot
Openshot Qt
提交
a6ab03d0
O
Openshot Qt
项目概览
openshot
/
Openshot Qt
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Openshot Qt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a6ab03d0
编写于
2月 24, 2021
作者:
J
Jonathan Thomas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Handling .torrent file differently, since the URL was invalid
上级
ef7036d4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
3 deletion
+29
-3
installer/deploy.py
installer/deploy.py
+29
-3
未找到文件。
installer/deploy.py
浏览文件 @
a6ab03d0
...
...
@@ -31,6 +31,7 @@ import datetime
import
platform
import
traceback
import
re
import
urllib3
from
github3
import
login
from
requests.auth
import
HTTPBasicAuth
from
requests
import
post
,
get
...
...
@@ -43,6 +44,9 @@ RELEASE_NAME_REGEX = re.compile(r'^OpenShot-v.*?(-.*?)\.')
# Access info class (for version info)
sys
.
path
.
append
(
os
.
path
.
join
(
PATH
,
'src'
,
'classes'
))
# Disable SSL warnings
urllib3
.
disable_warnings
()
if
__name__
==
"__main__"
:
"""Only run this code when directly executing this script. """
...
...
@@ -180,14 +184,20 @@ if __name__ == "__main__":
artifact_path
=
artifact_path_orig
artifact_base
,
artifact_ext
=
os
.
path
.
splitext
(
artifact_name
)
if
os
.
path
.
exists
(
artifact_path
)
and
artifact_ext
in
[
'.exe'
,
'.dmg'
,
'.AppImage'
,
'.torrent'
,
if
artifact_ext
==
'.torrent'
:
# Delete torrent and continue (we'll recreate the torrents below when needed)
# The artifact torrents have the incorrect URL inside them
os
.
unlink
(
artifact_path
)
continue
if
os
.
path
.
exists
(
artifact_path
)
and
artifact_ext
in
[
'.exe'
,
'.dmg'
,
'.AppImage'
,
'.verify'
,
'.sha256sum'
]:
# Valid artifact/installer - Upload to GitHub Release
output
(
"GitHub: Uploading %s to GitHub Release: %s"
%
(
artifact_path
,
github_release
.
tag_name
))
download_url
=
upload
(
artifact_path
,
github_release
)
# Create shasum
for installer
if
not
artifact_name
.
endswith
(
".torrent"
)
:
# Create shasum
and torrents for installers-only
if
artifact_ext
in
[
'.exe'
,
'.dmg'
,
'.AppImage'
]
:
output
(
"Generating file hash for %s"
%
artifact_path
)
shasum_output
=
''
for
line
in
run_command
(
'shasum -a 256 "%s"'
%
artifact_name
,
artifact_dir
):
...
...
@@ -230,6 +240,22 @@ if __name__ == "__main__":
f
.
write
(
' %s: OK'
%
artifact_name
)
upload
(
sha256sum_instructions_path
,
github_release
)
# Create torrent and upload
torrent_path
=
"%s.torrent"
%
artifact_path
torrent_command
=
'mktorrent -a "udp://tracker.openbittorrent.com:80/announce, udp://tracker.publicbt.com:80/announce, udp://tracker.opentrackr.org:1337" -c "OpenShot Video Editor %s" -w "%s" -o "%s" "%s"'
%
(
github_release
.
tag_name
,
download_url
,
"%s.torrent"
%
artifact_name
,
artifact_name
)
torrent_output
=
""
for
line
in
run_command
(
torrent_command
,
artifact_dir
):
output
(
line
)
if
line
:
torrent_output
=
line
.
decode
(
'UTF-8'
).
strip
()
if
not
torrent_output
.
endswith
(
"Writing metainfo file... done."
):
# Torrent failed
raise
Exception
(
"Failed to create .torrent for %s"
%
download_url
)
else
:
# Torrent succeeded! Upload the torrent to github
url
=
upload
(
torrent_path
,
github_release
)
# Submit blog post (if it doesn't already exist) (in draft mode)
auth
=
HTTPBasicAuth
(
os
.
getenv
(
'OPENSHOT_ORG_USER'
),
os
.
getenv
(
'OPENSHOT_ORG_PASS'
))
r
=
post
(
"https://www.openshot.org/api/release/submit/"
,
auth
=
auth
,
data
=
{
"version"
:
github_release
.
tag_name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录