Update build.yml #233
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 打包为应用程序 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 检出仓库 | |
uses: actions/checkout@v2 | |
- name: 设置 Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: 安装依赖 | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
- name: 安装 pkgconfiglite | |
run: | | |
- name: 打包应用程序 | |
run: | | |
pyinstaller --onefile main.py | |
- name: 创建包含其他文件夹的目录 | |
run: | | |
mkdir -p output | |
cp dist/main output/ | |
cp -r icons/ output/ | |
cp -r ui/ output/ | |
cp config.ini output/ | |
- name: 创建 zip 包含构建产物 | |
run: | | |
cd output | |
zip -r Bloret-Launcher.zip Bloret-Launcher.exe cmcl icons ui config.ini | |
- name: 上传构建产物 Bloret-Launcher.zip | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Bloret-Launcher | |
path: output/Bloret-Launcher.zip | |
- name: 上传构建产物 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: installer | |
path: dist/ |