From cdd5fe7f11c8c6278d9554aa24b12b3db44dd3f2 Mon Sep 17 00:00:00 2001 From: Monomux Date: Fri, 10 Feb 2023 22:27:14 +0800 Subject: [PATCH 1/2] fix:unable to package with param '-w' --- UIFunc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UIFunc.py b/UIFunc.py index eb2e680..4146823 100644 --- a/UIFunc.py +++ b/UIFunc.py @@ -38,8 +38,9 @@ 'Middle'] logger.remove() -logger.add(sys.stdout, backtrace=True, diagnose=True, - level='DEBUG') +if sys.stdout is not None: + logger.add(sys.stdout, backtrace=True, diagnose=True, + level='DEBUG') logger.add(to_abs_path('logs', '{time}.log'), rotation='20MB', backtrace=True, diagnose=True, level='INFO') From 1bc338813215b74d31957762703d125022d597fd Mon Sep 17 00:00:00 2001 From: Monomux Date: Fri, 10 Feb 2023 23:55:06 +0800 Subject: [PATCH 2/2] dev:use github action to publish release --- .github/workflows/release.yml | 87 +++++++++++++++++++++++++++++++++++ .gitignore | 1 - 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2346da0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,87 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: release + +on: + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +env: + keymousego-version: _v5_1_1 + +jobs: + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@main + - name: Set up Python 3.7 + uses: actions/setup-python@main + with: + python-version: "3.7" + - name: Install dependencies + run: | + pip3 install -r requirements-windows.txt + pip3 install pyinstaller + - name: Bundle Packages + run: | + pyinstaller -Fw --add-data './assets;assets' KeymouseGo.py + - name: Copy artifact + run: | + mkdir artifact && mv dist/KeymouseGo.exe ./artifact/KeymouseGo${{ env.keymousego-version }}-win.exe + - name: Artifact + uses: actions/upload-artifact@main + with: + name: windows + path: ${{ github.workspace }}/artifact/ + + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@main + - name: Set up Python 3.7 + uses: actions/setup-python@main + with: + python-version: "3.7" + - name: Install dependencies + run: | + pip3 install -r requirements-universal.txt + pip3 install pyinstaller + - name: Bundle Packages + run: | + pyinstaller -Fw --add-data './assets:assets' KeymouseGo.py + - name: Copy artifact + run: | + mkdir artifact && mv dist/KeymouseGo ./artifact/KeymouseGo${{ env.keymousego-version }}-linux + - name: Artifact + uses: actions/upload-artifact@main + with: + name: linux + path: ${{ github.workspace }}/artifact/ + + build-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@main + - name: Set up Python 3.7 + uses: actions/setup-python@main + with: + python-version: "3.7" + - name: Install dependencies + run: | + pip3 install -r requirements-universal.txt + pip3 install pyinstaller + - name: Bundle Packages + run: | + pyinstaller -Fw --add-data './assets:assets' KeymouseGo.py + - name: Copy artifact + run: | + mkdir artifact && mv dist/KeymouseGo ./artifact/KeymouseGo${{ env.keymousego-version }}-mac + - name: Artifact + uses: actions/upload-artifact@main + with: + name: macos + path: ${{ github.workspace }}/artifact/ diff --git a/.gitignore b/.gitignore index e6805ad..98d32b7 100644 --- a/.gitignore +++ b/.gitignore @@ -60,7 +60,6 @@ scripts/ # Custom configue file *.ini -.github plugins/ logs/ !assets/