Skip to content

Commit

Permalink
尝试用Linux构建
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Nov 22, 2023
1 parent bdaec47 commit 390132b
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions .github/workflows/pyinstaller-win-shawn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -138,7 +143,6 @@ jobs:
- name: restore mower
uses: actions/cache/restore@v3
with:
enableCrossOsArchive: true
key: mower-${{ github.sha }}
path: mower/mower

Expand Down

0 comments on commit 390132b

Please sign in to comment.