cicd-integrations
2025.10
true
- 概述
- UiPath CLI
- Azure DevOps 扩展程序
- Jenkins 插件
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。

CI/CD 集成用户指南
上次更新日期 2026年4月6日
打包解决方案
pack命令将创建一个可部署的解决方案包( .zip存档),此包可上传到 Orchestrator 中的解决方案。
命令语法
uipcli solution pack <solution-path> [options]
uipcli solution pack <solution-path> [options]
参数:
| 参数 | 描述 | 必填 |
|---|---|---|
<solution-path> (pos. 0) | 解决方案文件夹或.uipx文件的路径 | 是 |
--output | 将在其中创建包的目录 | 是 |
--version | x.y.z格式的版本号 | 是 |
-A、 --libraryOrchestratorAccountForApp (*) | Orchestrator CloudRPA 帐户名称(组织名称)。您必须将其与外部应用程序的应用程序(客户端)ID 、应用程序密码和应用程序作用域配对如果任何解决方案项目依赖于 Orchestrator 订阅源中的库或部署到 Orchestrator 的其他流程,则为必需。 | 否 |
-I ,--libraryOrchestratorApplicationId (*)(如果使用 外部应用程序身份验证, 则为必填项 ) | 外部应用程序 ID。您必须将其与“应用程序帐户” 、 “应用程序密码”和“应用程序作用域”配对。如果任何解决方案项目依赖于 Orchestrator 订阅源中的库或部署到 Orchestrator 的其他流程,则必须进行此步骤。 | 否 |
-S,--libraryOrchestratorApplicationSecret (*)(如果使用 外部应用程序身份验证, 则为必填项 ) | 外部应用程序密码。您必须将其与“应用程序帐户” 、 “应用程序 ID”和“应用程序作用域”配对。如果任何解决方案项目依赖于 Orchestrator 订阅源中的库或部署到 Orchestrator 的其他流程,则必须进行此步骤。 | 否 |
--libraryOrchestratorApplicationScope (*)(对于 外部应用程序身份验证 为可选 ) | 应用程序作用域列表,以单个空格分隔。您必须将其与外部应用程序的“应用程序帐户” 、 “应用程序 ID”和“应用程序密码”配对。如果任何解决方案项目依赖于 Orchestrator 订阅源中的库或部署到 Orchestrator 的其他流程,则必须进行此步骤。 | 否 |
--libraryOrchestratorUrl (*) | Orchestrator 实例的 URL。如果任何解决方案项目依赖于 Orchestrator 订阅源中的库或部署到 Orchestrator 的其他流程,则必须进行此步骤。 | 否 |
--libraryOrchestratorTenant (*) | Orchestrator 实例的租户。如果任何解决方案项目依赖于 Orchestrator 订阅源中的库或部署到 Orchestrator 的其他流程,则必须进行此步骤。 | 否 |
--libraryIdentityUrl(对于PaaS或MSI部署为必需) | 身份服务器的 URL。 | 否 |
--libraryOrchestratorFolder (*) | 目标 Orchestrator 文件夹的名称。 要输入子文件夹,请确保同时输入父文件夹的名称和子文件夹的名称。例如,AccountingTeam\TeamJohn。 | 否 |
--nugetConfigFilePath | 包含订阅源的 NuGet.Config 文件的路径。系统将忽略指定文件中的<clear />标签,仅考虑来源。 | 否 |
--disableBuiltInNugetFeeds | 禁用内置 NuGet 订阅源。 | 否 |
--repositoryUrl | 项目进行版本控制时所在的存储库 URL。 | 否 |
--repositoryCommit | 从中提交构建项目的存储库。 | 否 |
--repositoryBranch | 从中构建项目的存储库分支。 | 否 |
--repositoryType | VCS 系统存储库类型。 | 否 |
--projectUrl | Automation Hub 概念 URL。 | 否 |
--releaseNotes | 添加发行说明。 | 否 |
--author | 包作者。 | 否 |
--traceLevel | 显示事件的跟踪。 | 否 |
备注:
在不指定--libraryOrchestratorApplicationScope参数的情况下使用外部应用程序身份验证时,CLI 会自动应用这些默认的 Orchestrator 作用域:
Solutions.Packages Solutions.Deployments OR.Execution
示例
uipcli solution pack C:\Solutions\MySolution \
--output C:\Output \
--version 1.2.3 \
--traceLevel Verbose
uipcli solution pack C:\Solutions\MySolution \
--output C:\Output \
--version 1.2.3 \
--traceLevel Verbose
这将创建一个如下所示的包文件:
C:\Output\MySolution.1.2.3.zip
C:\Output\MySolution.1.2.3.zip
完整参数示例
uipcli solution pack C:\Solutions\MySolution \
--output C:\Output \
--version 1.2.3 \
--libraryOrchestratorAccountForApp MyOrgAccount \
--libraryOrchestratorApplicationId ******* \
--libraryOrchestratorApplicationSecret ******* \
--libraryOrchestratorApplicationScope "OR.Assets OR.Folders OR.Projects" \
--libraryOrchestratorUrl https://cloud.uipath.com/myOrgName/myTenantName \
--libraryOrchestratorTenant myTenantName \
--libraryIdentityUrl https://identity.uipath.com \
--libraryOrchestratorFolder "AccountingTeam\TeamJohn" \
--disableBuiltInNugetFeeds \
--repositoryUrl https://github.com/my-org/my-repo \
--repositoryCommit 7f3a9c2 \
--repositoryBranch main \
--repositoryType git \
--projectUrl https://automationhub.uipath.com/ideas/1234 \
--releaseNotes "Initial packaged solution version" \
--traceLevel Verbose
--author ExampleAuthor
uipcli solution pack C:\Solutions\MySolution \
--output C:\Output \
--version 1.2.3 \
--libraryOrchestratorAccountForApp MyOrgAccount \
--libraryOrchestratorApplicationId ******* \
--libraryOrchestratorApplicationSecret ******* \
--libraryOrchestratorApplicationScope "OR.Assets OR.Folders OR.Projects" \
--libraryOrchestratorUrl https://cloud.uipath.com/myOrgName/myTenantName \
--libraryOrchestratorTenant myTenantName \
--libraryIdentityUrl https://identity.uipath.com \
--libraryOrchestratorFolder "AccountingTeam\TeamJohn" \
--disableBuiltInNugetFeeds \
--repositoryUrl https://github.com/my-org/my-repo \
--repositoryCommit 7f3a9c2 \
--repositoryBranch main \
--repositoryType git \
--projectUrl https://automationhub.uipath.com/ideas/1234 \
--releaseNotes "Initial packaged solution version" \
--traceLevel Verbose
--author ExampleAuthor
版本控制要求
与独立项目不同,解决方案不会自动递增其版本号。您必须使用--version参数显式提供版本。
CI/CD 中的典型版本控制模式
大多数团队会根据内部版本元数据动态生成版本:
使用内部版本 ID:
--version "1.0.$BUILD_ID"
--version "1.0.$BUILD_ID"
使用 Git 提交 SHA:
--version "2.1.${GIT_COMMIT_SHA:0:7}"
--version "2.1.${GIT_COMMIT_SHA:0:7}"
将语义版本控制与日期结合使用:
--version "$(date +%Y.%m.$BUILD_NUMBER)"
--version "$(date +%Y.%m.$BUILD_NUMBER)"
版本格式
版本必须遵循语义版本控制:
- 格式:
MAJOR.MINOR.PATCH - 示例:
1.0.0、2.3.45、10.20.1234 - 必须包含正好三个数字组件,用点分隔
管道集成
Azure DevOps 示例
- script: |
uipcli solution pack $(Build.SourcesDirectory)\MySolution \
--output $(Build.ArtifactStagingDirectory) \
--version "1.0.$(Build.BuildId)" \
--traceLevel Information
displayName: 'Pack Solution'
- script: |
uipcli solution pack $(Build.SourcesDirectory)\MySolution \
--output $(Build.ArtifactStagingDirectory) \
--version "1.0.$(Build.BuildId)" \
--traceLevel Information
displayName: 'Pack Solution'
GitHub Actions 示例
- name: Pack Solution
run: |
uipcli solution pack ${{ github.workspace }}/MySolution \
--output ${{ runner.temp }}/packages \
--version "1.0.${{ github.run_number }}" \
--traceLevel Information
- name: Pack Solution
run: |
uipcli solution pack ${{ github.workspace }}/MySolution \
--output ${{ runner.temp }}/packages \
--version "1.0.${{ github.run_number }}" \
--traceLevel Information
要打包的内容
pack 命令捆绑包:
- 解决方案中包含的所有项目
- 项目级别的依赖项
- 解决方案元数据和配置
- 绑定特定于环境的设置的定义
生成的.zip文件是独立的,可以上传到 Orchestrator。
还原后打包
为获得最佳结果,请在pack之前运行restore ,以确保所有依赖项均已解析:
# 1. Restore dependencies
uipcli solution restore C:\Solutions\MySolution \
--restoreFolder C:\Output\Dependencies \
--traceLevel Information
# 2. Pack with explicit version
uipcli solution pack C:\Solutions\MySolution \
--output C:\Output \
--version 1.2.3 \
--traceLevel Verbose
# 1. Restore dependencies
uipcli solution restore C:\Solutions\MySolution \
--restoreFolder C:\Output\Dependencies \
--traceLevel Information
# 2. Pack with explicit version
uipcli solution pack C:\Solutions\MySolution \
--output C:\Output \
--version 1.2.3 \
--traceLevel Verbose
包输出位置
打包的.zip文件将放置在--output指定的目录中。如果该目录不存在,系统将自动创建。
典型输出路径
Azure DevOps:
--output $(Build.ArtifactStagingDirectory)
--output $(Build.ArtifactStagingDirectory)
GitHub 操作:
--output ${{ runner.temp }}/packages
--output ${{ runner.temp }}/packages
Jenkins:
--output ${WORKSPACE}/output
--output ${WORKSPACE}/output
后续步骤
打包后,您可以:
- 将包上传到 Solutions Management。
- 将其作为构建工件存储在 CI/CD 平台中。
- 在工件存储库(artifactory、Azure artifacts 等)中对其进行版本控制。