You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local rbxasset = require("./path/to/rbxasset/src")
15
+
```
16
+
11
17
# Usage
12
18
13
-
Create an `rbxasset.toml` file in your project with the following content:
19
+
Create an `rbxasset.toml` file in your project with the following content. Replace the environment configuration with values for the creator and experience to upload with.
14
20
15
21
```toml
16
22
[assets.default]
@@ -27,43 +33,93 @@ universeId = 7854970752
27
33
placeId = 119490202754966
28
34
```
29
35
30
-
To get deployment to work properly, the following are required:
31
-
*`creatorId`: The ID of the User or Group that will own the published assets
32
-
*`creatorType`: Either `"User"` or `"Group"`. This is just to tell rbxasset how to interpret `creatorId`
33
-
*`universeId`: The `game.GameId` of an experience that will be used for Luau Execution. The experience must be owned by the asset creator
34
-
*`placeId`: The `game.PlaceId` of an experience that will be used for Luau Execution. The experience must be owned by the asset creator
36
+
This defines a `default` asset and a `production` environment to deploy to.
37
+
38
+
Then create a Luau script to handle the deployment:
39
+
40
+
```luau
41
+
-- .lune/publish.luau
42
+
local process = require("@lune/process")
43
+
44
+
local rbxasset = require("./path/to/rbxasset/src")
45
+
46
+
local apiKey = process.args[1]
47
+
assert(apiKey, "argument #1 must be a valid Open Cloud API key")
48
+
49
+
-- The rbxm file needs to be built manually. rbxasset makes no assumptions about
50
+
-- how your project is setup, it only cares about having a file to upload. Note
51
+
-- the filename `build.rbxm` matches the `model` field in rbxasset.toml
Where `<API_KEY>` represents an Open Cloud API key. See below for the exact setup for the key.
63
+
64
+
## Open Cloud setup
35
65
36
-
## API Key
66
+
To get this all working you will need two things: an Open Cloud API key, and an Experience to handle asset publishing.
37
67
38
-
You will also need an Open Cloud API key with the following scopes:
68
+
### Asset uploader experience
69
+
70
+
Create a new Experience for the user or group that will own the asset. A fresh Baseplate named anything you like will do just fine.
71
+
72
+

73
+
74
+
Once the Experience is published, run the following from the command line:
75
+
76
+
```luau
77
+
print(game.GameId, game.PlaceId)
78
+
```
79
+
80
+
Copy both values and add them to `rbxasset.toml` for the environment's `universeId` and `placeId`, respectively.
81
+
82
+
> [!NOTE]
83
+
> In the future the hope is to not require an Experience to be created for the purpose of asset uploading. The reason this is needed right now is to close the gap of creating/updating the asset on the Creator Store via `CreateAssetAsync` and `CreateAssetVersionAsync`. If/when Open Cloud supports taking an rbxm file as input to create/update an asset, it will no longer be a requirement to setup an experience for asset uploading
84
+
85
+
### API key
86
+
87
+
An Open Cloud API key with the following scopes is required:
39
88
*`asset:read` and `asset:write`
40
89
*`universe-places:write`
41
90
*`universe.place.luau-execution-session:write`
42
91
43
92
The resulting permissions should be setup similar to the following:
44
93
45
-

94
+

46
95
47
-
## Package syncing
96
+
#Manifest format
48
97
49
-
The following example will take an rbxm file and upload it to the Creator Store using `rbxasset.toml` to define what the
50
-
display name, description, and icon will be.
98
+
This section details the various fields that can be supplied for assets and environments in `rbxasset.toml`
51
99
52
-
```luau
53
-
-- .lune/publish.luau
54
-
local process = require("@lune/process")
100
+
## Assets
55
101
56
-
local rbxasset = require("rbxasset")
102
+
Assets define how the asset will be deployed and shown on the Creator Store.
|`name`|`string`| The name of the asset on the Creator Store |
107
+
|`model`|`string`| Path to the rbxm to upload, relative to `rbxasset.toml`|
108
+
|`environment`|`string`| Defines which environment to deploy to. This value must equal one of the environments defined in the `environments` object |
109
+
|`description`|`string?`| The description of the asset on the Creator Store |
110
+
|`icon`|`string?`| Path to the icon (png only) to display on the Creator Store |
111
+
|`description`|`string?`| The description of the asset on the Creator Store |
112
+
|`type`|`"Package" \| "Plugin"`| The type of asset to upload to the Creator Store. This must be set before the first publish as asset type is immutable once uploaded. Defaults to `"Package"`|
Environments define where an asset will be deployed to. Only one environment is required, but more can be added to setup production/staging deployments.
0 commit comments