-
Notifications
You must be signed in to change notification settings - Fork 11
/
package.py
43 lines (31 loc) · 1.21 KB
/
package.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import sys
sys.path.append(sys.path[0] + "/../")
import utils
def rename_and_upload():
version = "0.0.1"
current_time = time.strftime("%Y%m%d", time.localtime())
dmg_path = "{0}/../releases/Qt-App.dmg".format(sys.path[0])
dmg_name = "Qt-App_{0}_{1}_x86_64.dmg".format(version, current_time)
out_dmg_path = "{0}/../releases/{1}".format(sys.path[0], dmg_name)
utils.removeFile(out_dmg_path)
os.rename(dmg_path, out_dmg_path)
json_path = "{0}/../releases/update.json".format(sys.path[0])
utils.generate_json(version, out_dmg_path, dmg_name, json_path)
base_url = "http://192.168.1.111:80/webdav/index.php/admin/packages/Qt-App/macos/"
username = "admin"
password = "password"
utils.upload_file(base_url + dmg_name, username, password, out_dmg_path)
utils.upload_file(base_url + "update.json", username, password, json_path)
def main():
rename_and_upload()
if __name__ == "__main__":
main()
# sudo spctl -vvv --assess --type execute /Applications/Qt-App.app
# 输出如下:
# /Applications/Qt-App.app: accepted
# source=Notarized Developer ID
# origin=Developer ID Application: ******(******)