Pack and sign a UPM package using Editor command-line arguments
Pack and sign a package from the command line using Unity Editor batch mode. Useful in CI/CD pipelines.
阅读时间2 分钟最后更新于 25 天前
Pack and sign your Unity Package Manager (UPM) package so it’s ready for distribution and compatible with Unity’s package signature ecosystem.
If you publish UPM packages using continuous integration (CI), you can create a signed package using the Unity Editor command-line interface (CLI). For other methods, refer to Methods for signing packages.
To gather your organization's Organization ID and sign your package from the command line:
- If the project that uses the package you want to sign is open, close the Unity Editor.
-
Go to the Unity Cloud Dashboard and select the organization you want to use for signing. For information about selecting or switching organizations, refer to Switch organization.
-
Copy the Organization ID value. Refer to Identify the organization ID.
- Open a terminal or command-line window.
- Change directories to the location of your Unity Editor. For information about using Unity Hub to locate your Editor location, refer to Installs.
- Input the following command, replacing the placeholder values represented by angled brackets:
Windows
Unity.exe -batchmode -username <email_address> -password <your_password> \ -upmPack <path_to_package_folder> <path_to_tarball> \ -cloudOrganization <your_organization_id>
macOS
Unity.app/Contents/MacOS/Unity -batchmode -username <email_address> -password <your_password> \ -upmPack <path_to_package_folder> <path_to_tarball> \ -cloudOrganization <your_organization_id>
Parameter to replace | Description |
|---|---|
| The email address you use to sign in to Unity products and services. |
| The password you use to sign in to Unity products and services. |
| The fully qualified path to the folder that contains the Note: Don't include |
| The output path where you want to save the signed tarball file (Note: If the folder doesn't exist, the command creates it for you. |
| The Organization ID you copied from the Unity Cloud Dashboard. |
The output tarball file contains an encrypted file (), which contains the package signature.
.attestation.p7mRefer to Share your package for information about distributing this tarball file to others.