Skip to content

Commit

Permalink
add support for creating experiences and places (#39)
Browse files Browse the repository at this point in the history
* implemented experience and place creation (BREAKING)
* switch to data upload endpoint
* updated readme
* removed unused deployMode feature
* added delete support for experiences and places
  • Loading branch information
blake-mealey authored Nov 11, 2021
1 parent 7bf2615 commit 45a1343
Show file tree
Hide file tree
Showing 9 changed files with 405 additions and 350 deletions.
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,9 @@ documentation](https://github.com/Roblox/foreman#readme).

### Authentication

In order to use any of the commands to save/publish places to Roblox, you must provide valid
authentication. This is provided via the `ROBLOX_API_KEY` environment variable. You can create an
API key in the Roblox [Creator portal](https://create.roblox.com/credentials).

You also must ensure your API key has the required permissions. It must have the Place Management
API System with the desired places added to it.

If you are using the `templates` feature you will also need to provide a `ROBLOSECURITY` cookie via
the `ROBLOSECURITY` environment variable. You can get the cookie from your browser dev tools on
roblox.com.
In order to use any of the commands to save/publish places to Roblox, you must provide a valid
`.ROBLOSECURITY` cookie. This is provided via the `ROBLOSECURITY` environment variable. You can get
the cookie from your browser dev tools on roblox.com.

### Configure deployments

Expand All @@ -52,7 +45,6 @@ file in the provided directory.
deployments:
- name: staging
branches: [dev, dev/*]
deployMode: save # optional; defaults to Publish
experienceId: 7067418676
placeIds:
start: 8468630367
Expand Down Expand Up @@ -168,7 +160,6 @@ jobs:
- name: Deploy project
run: rocat deploy
env:
ROBLOX_API_KEY: ${{ secrets.ROBLOX_API_KEY }}
ROBLOSECURITY: ${{ secrets.ROBLOSECURITY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
1 change: 0 additions & 1 deletion project-fixtures/multi-places/rocat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ deployments:
- name: production
branches: [main]
# tagCommit: true
# deployMode: save
experienceId: 3028808377
placeIds:
start: 7818935418
Expand Down
8 changes: 7 additions & 1 deletion project-fixtures/single-place/rocat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ deployments:
- name: production
branches: [main]
# tagCommit: true
# deployMode: save
experienceId: 3028808377
placeIds:
start: 7818935418
- name: preview

templates:
experience:
Expand Down Expand Up @@ -39,6 +39,12 @@ templates:
maxPlayerCount: 20
serverFill: { reservedSlots: 10 }
allowCopying: false
firstWorld:
file: start.rbxlx
name: World
secondWorld:
file: start.rbxlx
name: Second World

state:
remote:
Expand Down
14 changes: 6 additions & 8 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::roblox_api::{
DeployMode, ExperienceAnimationType, ExperienceAvatarType, ExperienceCollisionType,
ExperienceAnimationType, ExperienceAvatarType, ExperienceCollisionType,
ExperienceConfigurationModel, ExperienceGenre, ExperiencePermissionsModel,
ExperiencePlayableDevice, PlaceConfigurationModel, SocialSlotType,
};
Expand All @@ -13,7 +13,6 @@ pub struct Config {
#[serde(default = "Vec::new")]
pub deployments: Vec<DeploymentConfig>,

#[serde(default)]
pub templates: TemplateConfig,

#[serde(default)]
Expand Down Expand Up @@ -59,18 +58,16 @@ pub struct DeploymentConfig {
#[serde(default = "Vec::new")]
pub branches: Vec<String>,

#[serde(default)]
pub deploy_mode: DeployMode,

#[serde(default)]
pub tag_commit: bool,

pub experience_id: u64,
pub experience_id: Option<u64>,

#[serde(default = "HashMap::new")]
pub place_ids: HashMap<String, u64>,
}

#[derive(Deserialize, Default)]
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TemplateConfig {
pub experience: Option<ExperienceTemplateConfig>,
Expand Down Expand Up @@ -156,7 +153,6 @@ pub struct ExperienceTemplateConfig {
// avatar_scale_constraints: Option<HashMap<String, (f32, f32)>>, // TODO: figure out api

// other
// is_archived: Option<bool>,
pub developer_products: Option<HashMap<String, DeveloperProductConifg>>,
}

Expand Down Expand Up @@ -225,6 +221,8 @@ impl From<&ExperienceTemplateConfig> for ExperienceConfigurationModel {
},
universe_animation_type: config.avatar_animation_type,
universe_collision_type: config.avatar_collision_type,

is_archived: None,
}
}
}
Expand Down
Loading

0 comments on commit 45a1343

Please sign in to comment.