Skip to content

Commit

Permalink
Merge pull request #12 from HyperPlay-Gaming/fixes
Browse files Browse the repository at this point in the history
Lowercase project and account name, update readme, update zip log message
  • Loading branch information
BrettCleary authored Mar 15, 2024
2 parents 6b144fb + 90f86b8 commit c01fc15
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 13 deletions.
58 changes: 49 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ HyperPlay command line interface.
* [HyperPlay CLI](#hyperplay-cli)
* [Install](#install)
* [Usage](#usage)
* [Flags & Environment Variables](#flags_and_env)
* [YML](#yml)
* [Publish](#publish)
* [Flags and Environment Variables](#flags-and-environment-variables)
* [YML](#yml)
* [Commands](#commands)
* [FAQ](#faq)
<!-- tocstop -->

# Install
Expand Down Expand Up @@ -36,7 +38,13 @@ USAGE
...
```

## Flags & Environment Variables
## Publish

The `publish` command args and flags can be passed as CLI args or with a YML file.

Note that in either case, you must pass a private key for an address added to your project or account with the cli flag `--private-key <value>`.

### Flags and Environment Variables
```bash
$ hyperplay publish [ACCOUNT] [PROJECT] [RELEASE] [--meta-tx] [--network <value>] [--private-key <value>] [--web <value>]
[--darwin_amd64 <value>] [--darwin_arm64 <value>] [--windows_amd64 <value>] [--skip_hyperplay_publish] [--channel <value>]
Expand All @@ -58,19 +66,31 @@ HYPERPLAY_SKIP_HYPERPLAY_PUBLISH=false
HYPERPLAY_TARGET_CHANNEL=beta
```

## YML
### YML
Create a `hyperplay.yml` in your project folder.

`zip` is true if you want to zip the folder or file prior to upload.
- Note that for HyperPlay submissions, you will need `zip: true` unless you are uploading a zip file.

```yml
account: test-ground
project: test44
release: 0.0.7

platforms:
darwin_amd64: dist/darwin/amd64/hello-go
darwin_arm64: dist/darwin/arm64/hello-go
linux_amd64: dist/linux/amd64/hello-go
windows_amd64: dist/windows/amd64/hello-go
darwin_amd64:
path: dist/darwin/amd64/hello-go
zip: true
darwin_arm64:
path: dist/darwin/arm64/hello-go
zip: true
linux_amd64:
path: dist/linux/amd64/hello-go
zip: true
# dist/windows/amd64/hello-go.zip zipped in a separate step so we don't need to zip with the cli
windows_amd64:
path: dist/windows/amd64/hello-go.zip
zip: false

```

Expand Down Expand Up @@ -168,4 +188,24 @@ EXAMPLES
$ hyperplay publish ipfs/go-ipfs/v0.12.3 dist/
```
<!-- commandsstop -->
<!-- commandsstop -->

# FAQ

## How do I fix "user is not an account or project member"?

Make sure you pass the private key of your Release Manager with the flag `--private-key=<private_key>`

For HyperPlay Projects, make sure the public key is added as a Release Manager on your HyperPlay project. You can modify the project members at https://developers.hyperplay.xyz/<account_name>/<project_name>/settings.

It is also possible to add the public key directly to your project through the [Valist registry](https://polygonscan.com/address/0xd504d012d78b81fa27288628f3fc89b0e2f56e24) by calling `addProjectMember`.

## How do I find my account or project name?

To get the account name, navigate to the [HyperPlay Dev Portal](https://developers.hyperplay.xyz) and on the project card, you can find your account name in the "Published by: <account_name" text.

![image](https://github.com/HyperPlay-Gaming/cli/assets/27568879/d1f89e34-c6e0-494b-bba8-eb29a8c161fe)

To get the project name, click the project card. The project name is in the text input field with the "Game Name" label, shown below.

![image](https://github.com/HyperPlay-Gaming/cli/assets/27568879/f85b4e4b-0a1c-44df-a277-954fe48766ea)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hyperplay/cli",
"version": "2.10.1",
"version": "2.10.2",
"description": "Hyperplay CLI",
"author": "HyperPlay Labs, Inc.",
"bin": {
Expand Down
3 changes: 3 additions & 0 deletions src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export default class Publish extends Command {
if (!config.release) this.error('invalid release name');
if (!config.platforms) this.error('no platforms configured');

config.account = config.account.toLowerCase();
config.project = config.project.toLowerCase();

return {config, yamlConfig}
}

Expand Down
2 changes: 1 addition & 1 deletion src/releases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function uploadRelease(valist: Client, config: ReleaseConfig, yamlC
return [platform, filePath]
}
const zipPath = getZipName(filePath);
CliUx.ux.action.start(`zipping ${filePath}`);
CliUx.ux.action.start(`zipping ${zipPath}`);
await zipDirectory(filePath, zipPath);
CliUx.ux.action.stop();
return [platform, zipPath] as [string, string];
Expand Down

0 comments on commit c01fc15

Please sign in to comment.