Using the PureWeb CLI to integrate into a CI environment
It's possible to use PureWeb command line interface (CLI) in your continuous integration (CI) environment. Here's how!
- Create a project to contain the models you’re going to submit in an automated fashion. Note the Client Id and Secret.
- Install (or use npx) to run the CLI: https://www.npmjs.com/package/@pureweb/platform-cli
$ npm install -g @pureweb/platform-cli
3. Setup the CLI configuration:
$ pw config set client-id <CLIENT_ID>
$ pw config set client-secret <CLIENT_SECRET>
4. Build and package (zip) your model
5. Use the CLI to create or update the model:
$ pw model create <app-name> <path-to-zip>.zip --exe “Game/Game.exe”
6. If the app-name already exists, a new version will be created. To automatically set this as primary on upload, pass the --primary flag. Updates to already deployed models will be provisioned automatically.
7. If the app-name does not exist, a new model will be created. This will enter our deployment queue. You will not be able to upload a new model version if two already exist. You'll have to delete one.
$ pw model delete <model-id> <version>
You can also use pw model list to get fully formed JSON to determine versions to delete.
If your 3D project is in Unreal and you're using GitHub you might want to read Using GitHub Actions to build Unreal models.