@@ -10,25 +10,25 @@ jobs:
10
10
# 这里把release的url保存起来,方便后面自动上传打包好的文件
11
11
createrelease :
12
12
name : 发布版本
13
- runs-on : [ubuntu-latest]
13
+ runs-on : [ ubuntu-latest ]
14
14
steps :
15
- - name : 创建发布
16
- id : create_release
17
- uses : actions/create-release@v1
18
- env :
19
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20
- with :
21
- tag_name : ${{ github.ref }}
22
- release_name : Release ${{ github.ref }}
23
- draft : true
24
- prerelease : false
25
- - name : 输出发布地址到文件
26
- run : echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
27
- - name : 保存发布地址
28
- uses : actions/upload-artifact@v3
29
- with :
30
- name : release_url
31
- path : release_url.txt
15
+ - name : 创建发布
16
+ id : create_release
17
+ uses : actions/create-release@v1
18
+ env :
19
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20
+ with :
21
+ tag_name : ${{ github.ref }}
22
+ release_name : Release ${{ github.ref }}
23
+ draft : true
24
+ prerelease : false
25
+ - name : 输出发布地址到文件
26
+ run : echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
27
+ - name : 保存发布地址
28
+ uses : actions/upload-artifact@v3
29
+ with :
30
+ name : release_url
31
+ path : release_url.txt
32
32
33
33
# 编译
34
34
build :
@@ -40,20 +40,20 @@ jobs:
40
40
# 这里可以针对三大系统进行编译,很方便就能实现跨平台编译
41
41
# mac要打出app包需要特殊处理,否则就是普通的可执行文件
42
42
include :
43
- # macos还没测试
43
+ # macos 经过测试, 可以用可执行文件方式运行. 但是无法用.app包形式运行
44
44
- os : macos-latest
45
45
TARGET : macos
46
46
CMD_BUILD : >
47
- pyinstaller QBRssManager-mac .spec &&
48
- cd dist/ &&
49
- zip -r9 QBRssManager-mac.zip QBRssManager.app/
47
+ pyinstaller QBRssManager.spec &&
48
+ cd dist/ &&
49
+ zip -r9 QBRssManager-mac.zip QBRssManager
50
50
OUT_FILE_NAME : QBRssManager-mac.zip
51
51
ASSET_MIME : application/zip
52
52
# windows测试可用
53
53
- os : windows-latest
54
54
TARGET : windows
55
55
CMD_BUILD : pyinstaller QBRssManager.spec &&
56
- cd dist/
56
+ cd dist/
57
57
OUT_FILE_NAME : QBRssManager.exe
58
58
ASSET_MIME : application/vnd.microsoft.portable-executable
59
59
# linux环境加上qt环境后测试可用
@@ -68,49 +68,49 @@ jobs:
68
68
ASSET_MIME : application/zip # application/octet-stream
69
69
# 这里是编译的步骤
70
70
steps :
71
- # 尝试增加qt环境 有效!
72
- - name : Install Qt
73
- uses : jurplel/install-qt-action@v3
74
- with :
75
- aqtversion : ' ==2.1.*'
76
- version : ' 5.15.2'
77
- host : ' linux'
78
- target : ' desktop'
79
- arch : ' gcc_64'
80
- - uses : actions/checkout@v3
81
- # 降低python版本 兼容win7
82
- - name : 初始化 Python 3.8
83
- uses : actions/setup-python@v4
84
- with :
85
- python-version : ' 3.8'
86
- # 使用缓存 https://github.com/marketplace/actions/setup-python
87
- # 把依赖缓存起来,下次可以直接使用
88
- cache : ' pip'
89
- - name : 安装依赖
90
- run : |
91
- python -m pip install --upgrade pip
92
- pip install -r requirements.txt
93
- - name : 在 ${{matrix.TARGET}} 上用pyinstaller编译
94
- run : ${{matrix.CMD_BUILD}}
95
- - name : 从Release任务读取发布URL路径
96
- uses : actions/download-artifact@v3
97
- with :
98
- name : release_url
99
- - name : 获取发布文件名和上传URL路径
100
- id : get_release_info
101
- shell : bash
102
- # 解决兼容问题 https://github.com/actions/download-artifact#compatibility-between-v1-and-v2v3
103
- # v1的下载会自动建一个文件夹,v2和v3不会,所以可以直接cat同目录的文件
104
- run : |
105
- value=`cat release_url.txt`
106
- echo ::set-output name=upload_url::$value
107
- - name : 上传发布文件资源
108
- id : upload-release-asset
109
- uses : actions/upload-release-asset@v1
110
- env :
111
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
112
- with :
113
- upload_url : ${{ steps.get_release_info.outputs.upload_url }}
114
- asset_path : ./dist/${{ matrix.OUT_FILE_NAME}}
115
- asset_name : ${{ matrix.OUT_FILE_NAME}}
116
- asset_content_type : ${{ matrix.ASSET_MIME}}
71
+ # 尝试增加qt环境 有效!
72
+ - name : Install Qt
73
+ uses : jurplel/install-qt-action@v3
74
+ with :
75
+ aqtversion : ' ==2.1.*'
76
+ version : ' 5.15.2'
77
+ host : ' linux'
78
+ target : ' desktop'
79
+ arch : ' gcc_64'
80
+ - uses : actions/checkout@v3
81
+ # 降低python版本 兼容win7
82
+ - name : 初始化 Python 3.8
83
+ uses : actions/setup-python@v4
84
+ with :
85
+ python-version : ' 3.8'
86
+ # 使用缓存 https://github.com/marketplace/actions/setup-python
87
+ # 把依赖缓存起来,下次可以直接使用
88
+ cache : ' pip'
89
+ - name : 安装依赖
90
+ run : |
91
+ python -m pip install --upgrade pip
92
+ pip install -r requirements.txt
93
+ - name : 在 ${{matrix.TARGET}} 上用pyinstaller编译
94
+ run : ${{matrix.CMD_BUILD}}
95
+ - name : 从Release任务读取发布URL路径
96
+ uses : actions/download-artifact@v3
97
+ with :
98
+ name : release_url
99
+ - name : 获取发布文件名和上传URL路径
100
+ id : get_release_info
101
+ shell : bash
102
+ # 解决兼容问题 https://github.com/actions/download-artifact#compatibility-between-v1-and-v2v3
103
+ # v1的下载会自动建一个文件夹,v2和v3不会,所以可以直接cat同目录的文件
104
+ run : |
105
+ value=`cat release_url.txt`
106
+ echo ::set-output name=upload_url::$value
107
+ - name : 上传发布文件资源
108
+ id : upload-release-asset
109
+ uses : actions/upload-release-asset@v1
110
+ env :
111
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
112
+ with :
113
+ upload_url : ${{ steps.get_release_info.outputs.upload_url }}
114
+ asset_path : ./dist/${{ matrix.OUT_FILE_NAME}}
115
+ asset_name : ${{ matrix.OUT_FILE_NAME}}
116
+ asset_content_type : ${{ matrix.ASSET_MIME}}
0 commit comments