-
Notifications
You must be signed in to change notification settings - Fork 3
124 lines (101 loc) · 3.44 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
name: Publish
on:
push:
tags:
- '*'
jobs:
publish-mac:
name: Publish for macOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Create virtual environment
run: python3 -m venv .venv
- name: Activate virtual environment
run: source .venv/bin/activate
- name: Install dependencies
run: |
python3 -m pip install pillow pyinstaller python-dotenv
- name: Build PyInstaller application
run: |
pyinstaller --name RstEyeApp --windowed --onefile --add-data "med.gif:." --hidden-import=PIL.ImageTk --additional-hooks-dir=hooks app.py
- name: Zip the application
run: |
zip -r RstEyeApp.zip dist/RstEyeApp.app
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: RstEyeApp.zip
asset_name: RstEyeApp.zip
tag: ${{ github.ref }}
publish-ubuntu:
name: Publish for Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Docker image
run: docker build -t rsteye-build .
- name: Create container and copy binary
run: |
docker run --rm -v $(pwd):/host rsteye-build sh -c 'cp /app/dist/RstEyeApp /host/RstEyeApp'
- name: Create Debian package structure and build package
run: |
mkdir -p rsteye/DEBIAN
mkdir -p rsteye/usr/bin
mkdir -p rsteye/lib/systemd/system
cp RstEyeApp rsteye/usr/bin/RstEyeApp
cp debian_pkg_files/rsteye.service rsteye/lib/systemd/system/rsteye.service
cp debian_pkg_files/control rsteye/DEBIAN/control
cp debian_pkg_files/postinst rsteye/DEBIAN/postinst
cp debian_pkg_files/postrm rsteye/DEBIAN/postrm
chmod 755 rsteye/DEBIAN/postinst
chmod 755 rsteye/DEBIAN/postrm
dpkg-deb --build rsteye
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: rsteye.deb
asset_name: rsteye.deb
tag: ${{ github.ref }}
publish-windows:
name: Publish for Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Create virtual environment
run: python -m venv .venv
- name: Activate virtual environment
run: .\.venv\Scripts\activate
- name: Install dependencies
run: |
python -m pip install pillow pyinstaller python-dotenv
- name: Build PyInstaller application
run: |
pyinstaller --name RstEyeApp --onefile --add-data "med.gif;." --hidden-import=PIL.ImageTk --additional-hooks-dir=hooks app.py
- name: Install Inno Setup
run: |
choco install innosetup
- name: Create Inno Setup installer
shell: pwsh
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" setup.iss
- name: Upload files to a GitHub release
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist\Output\RstEyeInstaller.exe
asset_name: RstEyeInstaller.exe
tag: ${{ github.ref }}