forked from Hsdi/Shortcut_Sync_PotPlayer
更新 .github/workflows/build-exe.yml
Some checks failed
Build Windows EXE / build (push) Has been cancelled
Some checks failed
Build Windows EXE / build (push) Has been cancelled
This commit is contained in:
38
.github/workflows/build-exe.yml
vendored
38
.github/workflows/build-exe.yml
vendored
@@ -6,19 +6,19 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: Ubuntu_docker_act
|
runs-on: ubuntu-build # 使用 Ubuntu 基础镜像
|
||||||
steps:
|
steps:
|
||||||
|
# 第一步:安装所有需要的环境
|
||||||
- name: Install Node.js and Python
|
- name: Install Node.js and Python
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y curl wget git
|
apt-get install -y curl wget git software-properties-common
|
||||||
|
|
||||||
# 安装 Node.js 18
|
# 安装 Node.js 18
|
||||||
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
apt-get install -y nodejs
|
apt-get install -y nodejs
|
||||||
|
|
||||||
# 安装 Python 3.13
|
# 安装 Python 3.13
|
||||||
apt-get install -y software-properties-common
|
|
||||||
add-apt-repository ppa:deadsnakes/ppa -y
|
add-apt-repository ppa:deadsnakes/ppa -y
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y python3.13 python3.13-dev python3.13-distutils
|
apt-get install -y python3.13 python3.13-dev python3.13-distutils
|
||||||
@@ -26,26 +26,32 @@ jobs:
|
|||||||
ln -sf /usr/bin/python3.13 /usr/bin/python
|
ln -sf /usr/bin/python3.13 /usr/bin/python
|
||||||
ln -sf /usr/bin/python3.13 /usr/bin/python3
|
ln -sf /usr/bin/python3.13 /usr/bin/python3
|
||||||
|
|
||||||
|
# 安装 Wine (用于Windows交叉编译)
|
||||||
|
dpkg --add-architecture i386
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y wine64 wine32
|
||||||
|
|
||||||
# 验证安装
|
# 验证安装
|
||||||
node --version
|
echo "Node version: $(node --version)"
|
||||||
python --version
|
echo "Python version: $(python --version)"
|
||||||
|
echo "Wine version: $(wine --version)"
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Python (确保使用正确的版本)
|
# 安装 Python 依赖
|
||||||
run: |
|
- name: Install Python dependencies
|
||||||
python --version
|
|
||||||
pip --version
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install pyinstaller keyboard pywin32
|
pip install pyinstaller keyboard pywin32
|
||||||
|
|
||||||
- name: Build EXE
|
# 构建 EXE
|
||||||
|
- name: Build EXE with PyInstaller
|
||||||
run: |
|
run: |
|
||||||
pyinstaller --onefile --windowed --name Shortcut_Sync_PotPlayer main.py
|
# 使用 Wine 运行 PyInstaller 来构建 Windows EXE
|
||||||
|
wine python -m PyInstaller --onefile --windowed --name Shortcut_Sync_PotPlayer main.py
|
||||||
|
|
||||||
|
# 上传构建产物
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user