Skip to content

Commit 384eda3

Browse files
authored
add binary release workflow (#115)
Co-authored-by: ddvk <ddvk>
1 parent aa75e28 commit 384eda3

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Windows Binary Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-win-amd64:
10+
runs-on: windows-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Get the version
14+
id: get_version
15+
shell: bash
16+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
17+
- name: Set up Python 3.9 amd64
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: 3.9
21+
architecture: x64
22+
- name: Install dependencies
23+
shell: cmd
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m venv venv64
27+
venv64\Scripts\python -m pip install --upgrade pip wheel setuptools pyinstaller
28+
venv64\Scripts\python -m pip install .
29+
- name: Make package
30+
shell: cmd
31+
run: |
32+
venv64\Scripts\pyinstaller -n rmview --collect-all rmview --icon=assets\rmview.ico -F ./src/rmview/__main__.py
33+
md public
34+
move dist\rmview.exe public\rmview.exe
35+
- name: Package into zip
36+
uses: papeloto/action-zip@v1
37+
with:
38+
files: public/
39+
recursive: false
40+
dest: rmview_win_amd64_${{ steps.get_version.outputs.VERSION }}.zip
41+
- name: Release
42+
uses: softprops/action-gh-release@v1
43+
with:
44+
#body_path: doc/CHANGELOG-${{ steps.get_version.outputs.VERSION }}.txt
45+
files: rmview_win_amd64_${{ steps.get_version.outputs.VERSION }}.zip

src/rmview/rmview.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pathlib
12
from PyQt5.QtGui import *
23
from PyQt5.QtWidgets import *
34
from PyQt5.QtCore import *
@@ -48,8 +49,9 @@ class rMViewApp(QApplication):
4849

4950
def __init__(self, args):
5051
super(rMViewApp, self).__init__(args)
51-
52-
self.CONFIG_DIR = QStandardPaths.standardLocations(QStandardPaths.ConfigLocation)[0]
52+
path = QStandardPaths.standardLocations(QStandardPaths.ConfigLocation)[0]
53+
pathlib.Path(path).mkdir(parents=True, exist_ok=True)
54+
self.CONFIG_DIR = path
5355
self.DEFAULT_CONFIG = os.path.join(self.CONFIG_DIR, 'rmview.json')
5456
self.LOCAL_KNOWN_HOSTS = os.path.join(self.CONFIG_DIR, 'rmview_known_hosts')
5557

0 commit comments

Comments
 (0)