-
Notifications
You must be signed in to change notification settings - Fork 65
147 lines (133 loc) · 4.48 KB
/
release.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Release
on:
push:
tags:
- '*'
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
APPLICATION_NAME: handyview
jobs:
setup:
runs-on: ubuntu-latest
outputs:
APPNAME: ${{ steps.get_appname.outputs.APPNAME }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
steps:
- name: get-appname
id: get_appname
run: echo ::set-output name=APPNAME::${APPLICATION_NAME}
- name: get-version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
windows:
needs: [setup]
runs-on: windows-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-windows
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install Pillow scipy imagehash pyqt5
pip install pyinstaller
- name: build
run: |
pyinstaller -D handyview/handyviewer.py -i icon.ico --add-data="handyview;handyview" --add-data="icons;icons" --add-data="icon.png;." --add-data="icon.ico;." --add-data="VERSION;." --windowed --noconfirm --hidden-import="PIL.Image" --hidden-import="PIL.ImageDraw" --hidden-import="PyQt5.QtMultimedia" --hidden-import="PyQt5.QtMultimediaWidgets" --hidden-import="imagehash"
- name: package
run: |
cd dist
dir handyviewer
7z a -r ${{ env.PACKAGENAME }}.zip handyviewer
move ${{ env.PACKAGENAME }}.zip ..
cd ..
- name: upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}.zip
macos:
needs: [setup]
runs-on: macos-11
env:
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-macos
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install Pillow imagehash pyqt5
pip install pyinstaller
- name: build
run: |
sh pyinstaller_install_mac.sh
- name: create dmg
run: |
brew install create-dmg
sh create_dmg.sh
mv dist/handyviewer.dmg ${{ env.PACKAGENAME }}.dmg
- name: upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.PACKAGENAME }}
path: ${{ env.PACKAGENAME }}.dmg
release:
needs: [setup, windows, macos]
runs-on: ubuntu-latest
steps:
- name: download
uses: actions/download-artifact@v2
with:
path: artifacts
- name: create-release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: HandyView ${{ github.ref }} Release Note
body: |
🚀 See you again 😸
🚀Have a nice day 😸 and happy everyday 😃
🚀 Long time no see ☄️
✨ **Highlights**
✅ [Features] Support ...
🐛 **Bug Fixes**
🌴 **Improvements**
📢📢📢
<p align="center">
<img src="https://github.com/xinntao/HandyView/blob/master/icon_text.png" height=100>
</p>
draft: true
prerelease: false
- name: upload-windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-windows
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/${{ env.PACKAGENAME }}/${{ env.PACKAGENAME }}.zip
asset_name: ${{ env.PACKAGENAME }}.zip
asset_content_type: application/zip
- name: upload-macos
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGENAME: ${{ needs.setup.outputs.APPNAME }}-${{ needs.setup.outputs.VERSION }}-macos
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/${{ env.PACKAGENAME }}/${{ env.PACKAGENAME }}.dmg
asset_name: ${{ env.PACKAGENAME }}.dmg
asset_content_type: application/octet-stream