跳至正文
版本:bleeding-edge 🩸

商店

nanos world 商店 是一个平台,你可以在此与 nanos world 社区分享你的游戏模式资产

警告

商店仍在开发中。 我们正在逐步推出一些小的、可用的功能,以便与你一起构建和改进它!

关于商店

在商店中,你可以上传你的资产、包,发布新版本,创建团队等等! 它与资源库CLI 100% 集成!

服务器授权令牌

要使用 CLI,你必须在服务器的 Config.toml 中提供授权令牌,或者通过 --token 命令行传递。

此令牌用于验证你的账户以及下载/上传属于你团队的资产/包的权利。

生成新令牌

要生成新令牌,请转到你的 Profile → PAT 页面,然后按 + Create Token 按钮。 页面将提示你设置令牌的名称和过期日期。

创建完成后,请复制并保存令牌,如果丢失将无法恢复。

现在只需将你的令牌粘贴到 Config.tomltoken 字段中,或者将其作为 --token 传递给你的服务器,即可通过授权运行 CLI 命令!

Teams are group of users and are the "holders" of the Resources (Assets/Packages) in the Store.

目前只能在上传新资源时创建它们。

Once created, they can be modified under your Profile/Teams tab or at this link. 你可以添加更多成员,查看所有已上传的资源并编辑其信息。

Releases & Versions

nanos world Store counts on a Release/Version system, which you can upload new versions of your Resource. 你可以上传私有版本、Beta 版本、Alpha 版本和稳定版本,还可以添加更新日志。

Uploading new Resources

Uploading a Package or an Asset Pack through the UI is very straight. 在上传页面,你可以定义包名称(必须唯一,并遵循正确的模式 - 这是文件夹名称)、团队标题,并自定义描述

You must upload a .zip file with all content your or Package or Asset Pack, as it follows:

Guidelines

  1. 如果你的 Package 和 Assets 文件夹中有隐藏的 .cache 文件,请记得将其删除!
  2. 请在 Package.tomlAssets.toml 中设置正确的版本
  3. 你的 .zip 文件根目录中必须包含 Package.tomlAssets.toml 文件。

Categories & Tags

During the creation of your Resource, you can set the Categories and Tags to customize it.

标签主要用于分类,并且(很快)也可用于搜索。 And the Categories are used differently depending if it's a Package or an Asset Pack:

  • Package: Categories are used as the type of the Package (game-mode, script, loading-screen).
  • Asset Pack: Categories are used just like a more specific Tag.

Store API

You can download, upload and edit your resources through HTTPS requests, check it the Swagger documentation at https://api.nanos.world/store/docs. 更多教程即将推出™。 */}

自动化 GitHub 发布

社区资源

此工作流由社区维护。 有关更多详细信息,请访问开源 GitHub 仓库

如果你的包或资产包已上传到 GitHub,你可以使用社区创建的 nanos world Store Publisher Action 来自动上传新版本!

此操作会自动处理版本验证、包压缩和上传到商店。

设置 Github Action

1. 将你的令牌添加为密钥

  1. 按照 生成新令牌 部分中的说明创建令牌
  2. 转到你的仓库 SettingsSecrets and variablesActions
  3. 单击 New repository secret
  4. 名称:NANOS_STORE_TOKEN
  5. 密钥:你在第 1 步中生成的令牌
  6. 单击 Add secret

2) 创建工作流文件

在你的仓库中创建一个名为 .github/workflows/publish.yml.yml 文件,并添加以下内容:

.github/workflows/publish.yml
name: Publish to nanos world Store

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
name: Publish package
steps:
- uses: actions/checkout@v4

- uses: nanos-world/store-action@v1
with:
NANOS_PERSONAL_ACCESS_TOKEN: ${{ secrets.NANOS_STORE_TOKEN }}
NANOS_PACKAGE_NAME: 'your-package-name' # Replace with your package name

发布新版本

要发布新版本:

更新 Package.toml 中的版本:

Package.toml
[meta]
version = "1.0.1" # 与前一版本相比的增量

提交、标签并推送:

Terminal
git add Package.toml
git commit -m "Bump version to 1.0.1"
git tag v1.0.1
git push origin main --tags

推送标签后,Action 将自动发布你的包!

手动触发

你还可以使用 workflow_dispatch 事件,从仓库的 Actions 标签页手动触发工作流。

版本管理

该 Action 会自动从你的 Package.toml 文件中读取版本,并将其与商店版本进行比较。 本地版本必须高于商店版本,上传才能成功。

仓库中有多个包

如果你的仓库中有多个包,你可以使用 EXTRA_PACKAGE_PATHS 输入,以 JSON 数组格式一次性发布它们:

.github/workflows/publish.yml
with:
...
EXTRA_PACKAGE_PATHS: '["path/to/package1", "path/to/package2"]'

如需更高级的配置选项和疑难解答,请访问 Action 仓库