From 1485018c7c5b9a5b0c6a850f7c3aa190ed3c2cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E7=97=95Sky?= Date: Sat, 11 May 2024 22:21:54 +0800 Subject: [PATCH] =?UTF-8?q?add:=20github=20=E8=87=AA=E5=8A=A8=E6=89=93?= =?UTF-8?q?=E5=8C=85=20exe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 36 ++++++++++++++++++++++++++++++++++ main.spec | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 .github/workflows/build.yaml create mode 100644 main.spec diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..ce9d654 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,36 @@ +name: Auto PyInstaller Windows + +on: + # Trigger the workflow on new version tag + push: + tags: + - "v*.*.*" + + # Allow to run this workflow manually in web browser + workflow_dispatch: + +jobs: + build-windows: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.12.3' + architecture: 'x64' + + - name: Install pyinstaller + run: | + pip install pyinstaller + + - name: Build + run: | + python -m PyInstaller main.spec + + - name: Release + uses: softprops/action-gh-release@v2 + with: + files: dist/FreeC-win-x64.exe diff --git a/main.spec b/main.spec new file mode 100644 index 0000000..83d875d --- /dev/null +++ b/main.spec @@ -0,0 +1,38 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['FreeC.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='FreeC-win-x64', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +)