Skip to content

Commit b952e4e

Browse files
authored
Merge pull request #208 from taojy123/github_actions
Release:5.1.1
2 parents 1448998 + 1bc3388 commit b952e4e

File tree

3 files changed

+90
-3
lines changed

3 files changed

+90
-3
lines changed

.github/workflows/release.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: release
5+
6+
on:
7+
pull_request:
8+
branches: [ "master" ]
9+
10+
permissions:
11+
contents: read
12+
13+
env:
14+
keymousego-version: _v5_1_1
15+
16+
jobs:
17+
build-windows:
18+
runs-on: windows-latest
19+
steps:
20+
- uses: actions/checkout@main
21+
- name: Set up Python 3.7
22+
uses: actions/setup-python@main
23+
with:
24+
python-version: "3.7"
25+
- name: Install dependencies
26+
run: |
27+
pip3 install -r requirements-windows.txt
28+
pip3 install pyinstaller
29+
- name: Bundle Packages
30+
run: |
31+
pyinstaller -Fw --add-data './assets;assets' KeymouseGo.py
32+
- name: Copy artifact
33+
run: |
34+
mkdir artifact && mv dist/KeymouseGo.exe ./artifact/KeymouseGo${{ env.keymousego-version }}-win.exe
35+
- name: Artifact
36+
uses: actions/upload-artifact@main
37+
with:
38+
name: windows
39+
path: ${{ github.workspace }}/artifact/
40+
41+
build-linux:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@main
45+
- name: Set up Python 3.7
46+
uses: actions/setup-python@main
47+
with:
48+
python-version: "3.7"
49+
- name: Install dependencies
50+
run: |
51+
pip3 install -r requirements-universal.txt
52+
pip3 install pyinstaller
53+
- name: Bundle Packages
54+
run: |
55+
pyinstaller -Fw --add-data './assets:assets' KeymouseGo.py
56+
- name: Copy artifact
57+
run: |
58+
mkdir artifact && mv dist/KeymouseGo ./artifact/KeymouseGo${{ env.keymousego-version }}-linux
59+
- name: Artifact
60+
uses: actions/upload-artifact@main
61+
with:
62+
name: linux
63+
path: ${{ github.workspace }}/artifact/
64+
65+
build-macos:
66+
runs-on: macos-latest
67+
steps:
68+
- uses: actions/checkout@main
69+
- name: Set up Python 3.7
70+
uses: actions/setup-python@main
71+
with:
72+
python-version: "3.7"
73+
- name: Install dependencies
74+
run: |
75+
pip3 install -r requirements-universal.txt
76+
pip3 install pyinstaller
77+
- name: Bundle Packages
78+
run: |
79+
pyinstaller -Fw --add-data './assets:assets' KeymouseGo.py
80+
- name: Copy artifact
81+
run: |
82+
mkdir artifact && mv dist/KeymouseGo ./artifact/KeymouseGo${{ env.keymousego-version }}-mac
83+
- name: Artifact
84+
uses: actions/upload-artifact@main
85+
with:
86+
name: macos
87+
path: ${{ github.workspace }}/artifact/

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ scripts/
6060

6161
# Custom configue file
6262
*.ini
63-
.github
6463
plugins/
6564
logs/
6665
!assets/

UIFunc.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
'Middle']
3939

4040
logger.remove()
41-
logger.add(sys.stdout, backtrace=True, diagnose=True,
42-
level='DEBUG')
41+
if sys.stdout is not None:
42+
logger.add(sys.stdout, backtrace=True, diagnose=True,
43+
level='DEBUG')
4344
logger.add(to_abs_path('logs', '{time}.log'), rotation='20MB', backtrace=True, diagnose=True,
4445
level='INFO')
4546

0 commit comments

Comments
 (0)