更新时间:2024-01-23 GMT+08:00

使用yaml配置PyInstaller构建

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
version: 2.0 # 必须是2.0
steps:
  BUILD:
    - python: 
        name: PyInstaller构建
        image: cloudbuild@python3.6
        inputs: 
          command: |
            pip config set global.index-url https://pypi.org/simple
            pip config set global.trusted-host repo.xxcloud.com
            # -F创建单一的可执行文件,文件位置在dist目录下
            # 详细命令参见: https://pyinstaller.readthedocs.io/en/stable/usage.html
            pyinstaller -F  *.py

参数名

参数类型

描述

是否必填

默认值

name

/

构建步骤名称,可自定义。

image

/

镜像版本,“cloudbuild@”为固定部分,后面为支持的Python版本,可在“图形化”构建中查看PyInstaller构建支持的“工具版本”

cloudbuild@python3.6

command

string

执行命令。可根据实际需要输入相关代码。