Skip to content

Commit 3e23740

Browse files
committed
Add Unity Asset Store Uploader python CLI.
Change-Id: Iaa5d95bfed24b2dc4aeaf88c9b07e566736bbef5
1 parent d0f2487 commit 3e23740

File tree

7 files changed

+1013
-0
lines changed

7 files changed

+1013
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/download_artifacts_test_output/
44
/test_output/
55
/gradle.properties
6+
/.vscode/
67

78
.gradle/
89

build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ project.ext {
157157
cacheProperties.store(projectPropertiesFile.newWriter(), null)
158158
}
159159

160+
// UnityAssetUploader required environment variables.
161+
unityUsername = findProperty("UNITY_USERNAME")
162+
unityPassword = findProperty("UNITY_PASSWORD")
163+
unityPackageId = findProperty("UNITY_PACKAGE_ID")
164+
unityPackagePath = findFileProperty("UNITY_PACKAGE_PATH", null)
165+
160166
// Whether debug symbols should be included.
161167
debugEnabled = findProperty("NDEBUG") == null
162168

@@ -1013,6 +1019,15 @@ task testDownloadArtifacts(type: GradleBuild) {
10131019
buildFile "source/PlayServicesResolver/scripts/download_artifacts_test.gradle"
10141020
}
10151021

1022+
task testPackageUploaderTests(type: Exec) {
1023+
def outputDir = buildDir
1024+
def script = "source/UnityAssetUploader/unity_asset_uploader_test.py"
1025+
inputs.file script
1026+
outputs.dir outputDir
1027+
commandLine "python", script
1028+
workingDir = projectDir
1029+
}
1030+
10161031
task updateEmbeddedGradleWrapper(type: Zip) {
10171032
description "Update the gradle wrapper in gradle-template.zip"
10181033
from project.ext.scriptDirectory

source/UnityAssetUploader/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__pycache__/

source/UnityAssetUploader/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Unity Asset Uploader
2+
3+
Command-line interface to authenticate with the unity asset store
4+
servers, get information about publisher accounts, and upload new asset
5+
packages.
6+
7+
## Requirements
8+
9+
* Python 3
10+
* A Unity Asset Store [publisher account](https://publisher.assetstore.unity3d.com).
11+
12+
## Usage
13+
14+
positional arguments:
15+
{display_session_id,display_publisher_info,display_listings,upload_package}
16+
display_session_id Print (possibly refreshed) auth session ID.
17+
display_publisher_info
18+
Print publisher ID and name.
19+
display_listings Print information about each package listed under
20+
publisher account.
21+
upload_package Upload a local unitypackage file to unity asset store.
22+
Args:
23+
package_id: Package ID to upload, retrieved from get_display_listings.
24+
package_path: Path to source, retrieved from get_display_listings.
25+
26+
global arguments:
27+
-h, --help show this help message and exit
28+
--username USERNAME Username of the Unity publisher account. With --password, one of two ways to
29+
authenticate requests.
30+
Defaults to environment variable UNITY_USERNAME.
31+
--password PASSWORD Password of the Unity publisher account. With --username, one of two ways to
32+
authenticate requests.
33+
Defaults to environment variable UNITY_PASSWORD.
34+
--session_id SESSION_ID
35+
Session ID / auth key returned from display_session_id. Option 2 for
36+
authenticating requests.
37+
--server SERVER Server component of the asset store API URL.
38+
--unity_version UNITY_VERSION
39+
Version of Unity to report to the asset store.
40+
--tools_version TOOLS_VERSION
41+
Version of Tools plugin to report to the asset store.

0 commit comments

Comments
 (0)