From 390132beb3e5742aabf2f196fd2c423b57e9e57a Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Wed, 22 Nov 2023 16:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E7=94=A8Linux=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pyinstaller-win-shawn.yml | 48 +++++++++++---------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pyinstaller-win-shawn.yml b/.github/workflows/pyinstaller-win-shawn.yml index f9a17fd50..d156a82e7 100644 --- a/.github/workflows/pyinstaller-win-shawn.yml +++ b/.github/workflows/pyinstaller-win-shawn.yml @@ -57,46 +57,51 @@ jobs: path: _site build-mower: - runs-on: windows-2022 + runs-on: ubuntu-22.04 steps: - name: download source uses: actions/checkout@v4 - name: change version number if: github.event.head_commit.message != '发版' - shell: bash + run: sed -i "s/__version__ = '\(.*\)'/__version__ = '\1+${GITHUB_SHA::7}'/g" ./arknights_mower/__init__.py + + - name: install wine run: | - sed -i "s/__version__ = '\(.*\)'/__version__ = '\1+${GITHUB_SHA::7}'/g" ./arknights_mower/__init__.py + sudo dpkg --add-architecture i386 + sudo apt update + sudo apt install wine - name: install python 3.8 - uses: actions/setup-python@v4 - with: - python-version: 3.8 - cache: pip + working-directory: py38 + run: | + wget https://www.python.org/ftp/python/3.8.10/python-3.8.10-embed-amd64.zip + unzip python-3.8.10-embed-amd64.zip + wget https://bootstrap.pypa.io/get-pip.py + wine python.exe get-pip.py - name: Install dependencies - shell: cmd run: | - python -m venv venv - venv\Scripts\pip install -r requirements.txt - venv\Scripts\pip install -U pyinstaller + wine py38/Scripts/pip.exe install -r requirements.txt + wine py38/Scripts/pip.exe install -U pyinstaller - name: install UPX - uses: crazy-max/ghaction-upx@v2 - with: - install-only: true - - - name: Make package - shell: cmd + working-directory: ~/.wine/drive_c + run: | + wget https://github.com/upx/upx/releases/download/v4.2.1/upx-4.2.1-win64.zip + unzip upx-4.2.1-win64.zip + mv upx-4.2.1-win64 upx + + - name: make package + env: + PYTHONHASHSEED: 114514 + SOURCE_DATE_EPOCH: 1694076231 run: | - set PYTHONHASHSEED=114514 - set SOURCE_DATE_EPOCH=1694076231 - venv\Scripts\pyinstaller .\webui_zip.spec --distpath=mower + wine py38/Scripts/pyinstaller ./webui_zip.spec --upx-dir C:\\upx --distpath=mower - name: cache mower uses: actions/cache/save@v3 with: - enableCrossOsArchive: true key: mower-${{ github.sha }} path: mower/mower @@ -138,7 +143,6 @@ jobs: - name: restore mower uses: actions/cache/restore@v3 with: - enableCrossOsArchive: true key: mower-${{ github.sha }} path: mower/mower