Pack and sign a UPM package with Unity Package Manager CLI
Use UPM CLI to pack a custom package into a signed tarball.
読み終わるまでの所要時間 3 分最終更新 1ヶ月前
Use the command in the Unity Package Manager command-line interface (UPM CLI) to pack a Unity Package Manager (UPM) package into a signed tarball that you can distribute or publish.
upm packThe command takes the folder structure of a custom package, packs it, and signs it with your organization credentials. The output is a signed tarball () file.
upm pack.tgzYou can run this command locally or as part of a continuous integration (CI) pipeline.
The only data that the command sends is the information required by the signing service so it can sign the package against the specified organization ID.
upm packPrerequisites
Before you use the command, make sure you completed all the installation prerequisites and installed the UPM CLI.
upm packSyntax
upm pack <package-directory> --organization-id <id> --destination <path>
The following table describes the parameters for the command:
upm packParameter | Required | Description |
|---|---|---|
| No | An absolute or relative path to the root folder of the custom package to pack. This is the folder that contains the package manifest file ( You can use an absolute or relative path. Note: You can omit this parameter if you set the root of your package directory as the current working directory before running |
| Yes | The organization ID you copied from the Unity Cloud Dashboard. Refer to the prerequisites in Install Unity Package Manager CLI. |
| No | The output path where UPM CLI places the signed tarball. If you specify a folder that doesn't exist, UPM CLI creates it. Note: If you omit this parameter, UPM CLI places the file in the current working directory. |
Pack and sign your package
To pack a UPM package and create a signed tarball:
-
Open a terminal window (macOS or Linux) or a PowerShell window (Windows).
-
(Optional) Go to the root directory of your custom package. This is the folder that contains your package'sfile. If you don't navigate to this directory, specify its location as the
package.jsonparameter.<package-directory> -
Run thecommand:
upm packupm pack <package-directory> --organization-id <id> --destination <path>Replace the placeholder values as described in the parameter table.
Output
The command creates a signed file in the location specified by the parameter. If you didn't specify a destination, UPM CLI places the file in the current working directory.
upm pack.tgz--destinationExample
The following command packs the package in the subfolder of the current working directory, signs it with the specified organization ID, and places the output tarball in the subfolder:
packageoutputupm pack ./package --organization-id 1234567890123 --destination ./output