@next2d/builder 0.1.11 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -57
- package/dist/cli.d.ts +7 -0
- package/dist/cli.js +68 -3
- package/dist/colors.d.ts +6 -0
- package/dist/colors.js +7 -0
- package/dist/context.d.ts +10 -1
- package/dist/context.js +7 -0
- package/dist/description.d.ts +2 -0
- package/dist/description.js +8 -0
- package/dist/electron-config.d.ts +52 -0
- package/dist/electron-config.js +116 -0
- package/dist/electron-host.d.ts +5 -0
- package/dist/electron-host.js +42 -0
- package/dist/electron.d.ts +4 -9
- package/dist/electron.js +83 -132
- package/dist/index.js +21 -0
- package/dist/native.d.ts +9 -24
- package/dist/native.js +48 -106
- package/dist/project-vite.d.ts +3 -0
- package/dist/project-vite.js +21 -0
- package/dist/resolve-tool-packages.d.ts +1 -0
- package/dist/resolve-tool-packages.js +29 -0
- package/dist/steam-upload.d.ts +27 -0
- package/dist/steam-upload.js +131 -0
- package/dist/steam.d.ts +22 -0
- package/dist/steam.js +193 -0
- package/dist/tool-packages.d.ts +15 -0
- package/dist/tool-packages.js +74 -0
- package/dist/web.js +10 -4
- package/dist/xbox.d.ts +1 -1
- package/dist/xbox.js +60 -57
- package/docs/capacitor.md +201 -0
- package/docs/steam.md +714 -0
- package/docs/xbox.md +145 -0
- package/package.json +9 -12
- package/templates/electron/entitlements.plist +12 -0
- package/templates/electron/icons/icon.icns +0 -0
- package/templates/electron/icons/icon.ico +0 -0
- package/templates/electron/icons/icon.png +0 -0
- package/templates/electron/index.js +95 -0
- package/templates/electron/local-assets.cjs +24 -0
- package/templates/electron/package.json +11 -0
- package/templates/xbox/src/platform/StbTextRasterizer.cpp +14 -10
- package/templates/xbox/tests/check_local.sh +12 -4
- package/templates/xbox/tests/stb_safety_test.cpp +126 -0
- package/templates/xbox/third_party/LICENSES.md +15 -0
- package/templates/xbox/third_party/stb_image.h +15 -10
- package/templates/xbox/third_party/stb_truetype.h +4 -4
- package/templates/xbox/third_party/stb_vorbis.c +1 -1
package/docs/steam.md
ADDED
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
# Steam 書き出し / アップロード / Export / Upload
|
|
2
|
+
|
|
3
|
+
[日本語](#日本語) | [English](#english)
|
|
4
|
+
|
|
5
|
+
## 日本語
|
|
6
|
+
|
|
7
|
+
ローカルへの書き出しだけなら、Steamworks・SteamCMD・配布用の署名認証は不要。
|
|
8
|
+
|
|
9
|
+
### STEP1:対象OSの実行環境とアイコンを用意する
|
|
10
|
+
|
|
11
|
+
- macOSのUniversalアプリと配布用の署名・公証はmacOS上で行う。
|
|
12
|
+
- Next2D Frameworkのテンプレートの `src/assets/icons/` にWindows用ICO、macOS用ICNS、Linux用PNGを用意する。
|
|
13
|
+
テンプレートの仮アイコンは配布前に差し替える。設定の省略時の扱いはSTEP3の表を参照。
|
|
14
|
+
|
|
15
|
+
#### 対応OS・CPU
|
|
16
|
+
|
|
17
|
+
| OS | 既定値 | `architectures` / `--arch` の対応値 |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| Windows | `x64` | `x64`, `arm64` |
|
|
20
|
+
| macOS | `universal` | `x64`, `arm64`, `universal` |
|
|
21
|
+
| Linux | `x64` | `x64`, `arm64` |
|
|
22
|
+
|
|
23
|
+
### STEP2:SteamworksのApp・Depot・テスト用ブランチを用意する(Steam配布時)
|
|
24
|
+
|
|
25
|
+
1. 対象アプリのSteamworks管理画面で、発行済みのApp IDを確認する。
|
|
26
|
+
2. SteamPipe > DepotsでDepotを作成し、対象OSを設定する。言語共通ならAll languagesを選び、
|
|
27
|
+
Save Changesで保存後、公開(Publish)タブで変更を反映する。
|
|
28
|
+
開発用・テスト用・販売用Packageにも必要なDepotを含める。**Depot IDはApp IDから推測せず、実際の値を使う。**
|
|
29
|
+
3. SteamPipe > Buildsで `internal` ブランチを作成し、**パスワードを設定して関係者だけに共有する。**
|
|
30
|
+
名前だけでは非公開にならず、builderはブランチ作成・パスワード設定や確認を行わない。
|
|
31
|
+
4. テスターにゲームと対象Depotの利用権を用意する。未発売ゲームの外部テスターには
|
|
32
|
+
Release State Override(beta)キー等を使う。ブランチのパスワードだけでは利用権は付与されない。
|
|
33
|
+
パスワードを第三者に共有しないよう運用し、JSONやリポジトリにも保存しない。
|
|
34
|
+
|
|
35
|
+
#### 複数Depotの構成とbuilderの対応範囲
|
|
36
|
+
|
|
37
|
+
**Steamでは1つのApp IDに複数Depotを設定できる。** OS固有ファイルはOS別Depotに分ける構成をValveが推奨している。
|
|
38
|
+
|
|
39
|
+
| 構成 | Steam | 現在のbuilder |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| Windows / macOS / Linuxを別Depotにする | 対応。各Depotの対象OSを指定する。 | 対応。`steam.depots` の各OSに異なる発行済みIDを設定する。 |
|
|
42
|
+
| 複数OSを1つのDepotにまとめる | 対応。対象OSをAll OSesなど構成に合わせる。 | 対応。対象OSに同じIDを設定する。各OSのファイルをサブディレクトリに分ける。全対象OSのファイルを配布するため容量が増える。 |
|
|
43
|
+
| 一部OSだけ同じDepotにする | 対応。 | 対応。共有するOSだけ同じIDにする。 |
|
|
44
|
+
| 同じOS向けに本体・共通アセット・言語などを複数Depotに分ける | 対応。複数Depotの内容をインストール時に組み合わせる。 | 未対応。各OSの値は単一のDepot IDで、配列や追加アセット用キーには対応しない。 |
|
|
45
|
+
|
|
46
|
+
builderの設定可能数は各OSに1 ID、全体で最大3つの異なるID。この上限はbuilderの設定形式によるもので、Steamの上限ではない。
|
|
47
|
+
OSごとの成果物を揃える手順と起動パスはSTEP5、複数Depotを1回でアップロードする手順はSTEP6を参照する。
|
|
48
|
+
|
|
49
|
+
Steam側のダウンロード対象はPackageの利用権とDepotのOS・言語などの条件で決まる。
|
|
50
|
+
同時にインストールするDepotで同じパスが重なると、Depot一覧の後にあるものが優先されるため、ファイルの配置を確認する。
|
|
51
|
+
これらの選択条件はSteamworks側で設定し、builderのJSONからは反映しない。
|
|
52
|
+
|
|
53
|
+
`internal` / `beta` はAppのビルドを選ぶブランチで、ブランチごとに別Depotを作る必要はない。
|
|
54
|
+
また、この文書の「共有Depot」は同一App内で複数OSをまとめる意味。
|
|
55
|
+
Steamworksの「Add Shared Depot」は別AppのDepotを参照する機能であり、builderの同一ID指定とは別の操作。
|
|
56
|
+
|
|
57
|
+
[Depotの設定](https://partner.steamgames.com/doc/store/application/depots) /
|
|
58
|
+
[Packageと利用権](https://partner.steamgames.com/doc/store/application/packages) /
|
|
59
|
+
[複数Depotのアップロード](https://partner.steamgames.com/doc/sdk/uploading) /
|
|
60
|
+
[betaブランチ](https://partner.steamgames.com/doc/store/application/branches) /
|
|
61
|
+
[Steamでのテスト](https://partner.steamgames.com/doc/store/testing) /
|
|
62
|
+
[Release State Overrideキー](https://partner.steamgames.com/doc/features/keys)
|
|
63
|
+
|
|
64
|
+
### STEP3:electron.config.jsonを設定する
|
|
65
|
+
|
|
66
|
+
プロジェクトルートの `electron.config.json` でゲーム固有設定を管理する。
|
|
67
|
+
JavaScript / TypeScriptの両テンプレートに含まれるので、初期値を自分のゲームの値に変更する。
|
|
68
|
+
`appId` は macOS bundle ID・保存先識別子、`steam.appId` は Valve の数値 App ID。
|
|
69
|
+
これらは別のID。バージョンはゲームルートの `package.json` を使う。
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"appId": "app.example.game",
|
|
74
|
+
"appName": "My Game",
|
|
75
|
+
"executableName": "my-game",
|
|
76
|
+
"companyName": "Example Company",
|
|
77
|
+
"icons": {
|
|
78
|
+
"windows": "src/assets/icons/icon.ico",
|
|
79
|
+
"macos": "src/assets/icons/icon.icns",
|
|
80
|
+
"linux": "src/assets/icons/icon.png"
|
|
81
|
+
},
|
|
82
|
+
"architectures": { "windows": "x64", "macos": "universal", "linux": "x64" },
|
|
83
|
+
"window": { "width": 1280, "height": 720, "fullscreen": false },
|
|
84
|
+
"steam": {
|
|
85
|
+
"appId": null,
|
|
86
|
+
"branch": "internal",
|
|
87
|
+
"depots": { "windows": null, "macos": null, "linux": null }
|
|
88
|
+
},
|
|
89
|
+
"macos": { "sign": false, "notarize": false }
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
| 項目 | 用途・仕様 | 省略時・注意点 |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `companyName` | Windows実行ファイルの会社名。 | 省略時は `package.json` の `author.name`、なければゲーム名。 |
|
|
96
|
+
| `appName` / `executableName` | `appName` はウィンドウ・アプリケーション名。`executableName` は実行ファイル名。 | 表示名と実行ファイル名を個別に設定できる。 |
|
|
97
|
+
| `description` | 任意の説明文。生成するElectronホストの `package.json` とWindowsのファイル説明に反映する。 | JSONの値を優先。未指定または `null` ならルートの `package.json` の `description` を使う。両方未指定なら空文字。明示的な `""` も空文字として扱う。 |
|
|
98
|
+
| `icons` | アイコン画像のパス。プロジェクトルートからの相対パス、または絶対パスを指定する。WindowsはICO、macOSはICNS、LinuxはPNG。 | 各キーは省略可。省略したOSにはbuilder同梱の仮のNext2Dアイコンを使う。`"icons": {}` なら全OSで仮アイコンを使える。指定したファイルがなければ失敗する。 |
|
|
99
|
+
| `architectures` | OSごとのCPU設定。対応値はSTEP1の「対応OS・CPU」を参照。 | 省略時はWindows/Linuxが `x64`、macOSが `universal`。`--arch` が優先する。 |
|
|
100
|
+
| `steam.appId` | Valveの数値App ID。未発行なら `null` を指定する。 | 未発行でもローカル書き出しは可能。SteamPipe用VDFは生成しない。 |
|
|
101
|
+
| `steam.branch` | `--steam-upload` の反映先betaブランチ。 | 省略時は `internal`。`--steam-branch` が優先する。ブランチの作成・パスワード設定はSteamworks側で行う。 |
|
|
102
|
+
| `steam.depots` | Steamworksで作成した実際のDepot ID。複数OSに同じIDを指定すると、同一Depotへまとめて配布する。 | App IDから推測しない。`null` / 未指定ならアプリと起動情報だけを生成し、アップロード用VDFは生成しない。 |
|
|
103
|
+
| `macos` | macOSアプリの署名・公証設定。 | ローカル検証用は `sign` / `notarize` ともに `false`。本番配布では両方を有効化する。 |
|
|
104
|
+
|
|
105
|
+
### STEP4:署名・アップロードの認証を用意する(配布時)
|
|
106
|
+
|
|
107
|
+
#### macOSの署名・公証
|
|
108
|
+
|
|
109
|
+
macOSのキーチェーンにDeveloper ID Application証明書と対応する秘密鍵を登録し、
|
|
110
|
+
`xcrun notarytool store-credentials` で公証用プロファイルを保存する。認証情報はJSONへ書かない。
|
|
111
|
+
|
|
112
|
+
`APPLE_SIGNING_IDENTITY` に指定する署名IDは、次のコマンドで確認できる。
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
security find-identity -v -p codesigning
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
表示された有効な署名IDから `Developer ID Application: ...` を選び、ダブルクォート内の名前全体を
|
|
119
|
+
`APPLE_SIGNING_IDENTITY` に指定する。以下の `YOUR NAME (TEAMID)` は実際の表示に置き換える。
|
|
120
|
+
環境変数を設定するだけでは証明書は作成されない。
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
export APPLE_SIGNING_IDENTITY='Developer ID Application: YOUR NAME (TEAMID)'
|
|
124
|
+
export APPLE_NOTARY_PROFILE='your-notary-profile'
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
配布用は `macos.sign` / `macos.notarize` を両方 `true` にする。
|
|
128
|
+
またはSTEP5のmacOSコマンドに `NEXT2D_STEAM_RELEASE=1` を付けると、JSONのfalse指定に関わらず両方を必須にできる。
|
|
129
|
+
認証情報不足・署名失敗・公証失敗はビルド失敗となる。
|
|
130
|
+
署名エラーは公証へ進まずに停止する。`Signature=adhoc` / `TeamIdentifier=not set` が出る場合は、
|
|
131
|
+
Developer ID署名が付いていないため、先に表示された署名エラーとキーチェーンの証明書・秘密鍵を確認する。
|
|
132
|
+
|
|
133
|
+
Steam用のターゲットは `darwin`。Valveは新規macOSアプリに64bitとAppleの公証を要求する。
|
|
134
|
+
テンプレートのentitlementsはJITとSteam Overlay用のlibrary validation / DYLD設定を含み、
|
|
135
|
+
`com.apple.security.app-sandbox` は付けない(Chromiumのrenderer sandboxとは別)。
|
|
136
|
+
[Valveのプラットフォーム要件](https://partner.steamgames.com/doc/store/application/platforms) /
|
|
137
|
+
[Electron Packagerの署名・公証設定](https://electron.github.io/packager/main/interfaces/Options.html)
|
|
138
|
+
|
|
139
|
+
#### SteamCMDとビルドアカウント
|
|
140
|
+
|
|
141
|
+
[Steamworks SDKのContentBuilder](https://partner.steamgames.com/doc/sdk/uploading)にある実行OS用のSteamCMDを用意する。
|
|
142
|
+
Windowsは `steamcmd.exe`、macOS / Linuxは `steamcmd.sh` を使用できる。
|
|
143
|
+
PATH上の `steamcmd`(Windowsは `steamcmd.exe`)を使うか、環境変数 `STEAMCMD` に実行ファイルのパスを指定する。
|
|
144
|
+
引数やシェルコマンドを含めず、パスだけを指定する。`.sh` は実行権限が必要。
|
|
145
|
+
SteamCMD自体の実行に必要なOSライブラリはSteamCMDの手順に従って用意する。
|
|
146
|
+
|
|
147
|
+
アップロード用アカウントには対象アプリの `Edit App Metadata` と `Publish App Changes To Steam` の権限を付与する。
|
|
148
|
+
macOS / Linuxの設定例(配置先とアカウント名を置き換える):
|
|
149
|
+
|
|
150
|
+
```sh
|
|
151
|
+
export STEAMCMD="/absolute/path/to/steamcmd.sh"
|
|
152
|
+
export STEAM_USERNAME="your_build_account"
|
|
153
|
+
"$STEAMCMD" +login "$STEAM_USERNAME" +quit
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
初回ログインではSteamCMDにパスワードと、要求された場合はSteam Guardコードを対話入力する。
|
|
157
|
+
ログイン成功後も、`+quit` による正常終了まで待ち、通常のターミナルのプロンプトに戻ったことを確認する。
|
|
158
|
+
`Steam>` で手動ログインした場合も、`quit` を入力して終了してからアップロードへ進む。
|
|
159
|
+
その後builderは同じSteamCMD・同じアカウントの保存済みログインを使い、パスワードをコマンド引数へ渡さない。
|
|
160
|
+
Steamアプリへのログインだけでは、このSteamCMDの認証準備を完了したことにはならない。
|
|
161
|
+
|
|
162
|
+
アップロード時に `Cached credentials not found` / `No cached credentials and @NoPromptForPassword is set` が出た場合や、
|
|
163
|
+
認証が失効した場合は、上の `"$STEAMCMD" +login "$STEAM_USERNAME" +quit` を再実行し、正常終了後にアップロードを再実行する。
|
|
164
|
+
builderからの実行は対話入力を待たず失敗させるため、builderの再実行だけではログイン情報を登録できない。
|
|
165
|
+
CIではSteamCMDの `config/config.vdf` をSecretとして復元・管理し、ビルド成果物に含めない。
|
|
166
|
+
Windows PowerShellでは `$env:STEAMCMD` と `$env:STEAM_USERNAME` を設定する。
|
|
167
|
+
|
|
168
|
+
### STEP5:各OSを書き出し、成果物を揃える
|
|
169
|
+
|
|
170
|
+
ゲームルートで必要なOSのコマンドを実行する。書き出しはアップロード・公開を行わない。
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
npx @next2d/builder --platform steam:windows --env prd
|
|
174
|
+
npx @next2d/builder --platform steam:macos --env prd
|
|
175
|
+
npx @next2d/builder --platform steam:linux --env prd
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
CPUを変える場合は `--arch arm64` などを追加する。
|
|
179
|
+
テンプレートの `npm run build:steam:windows` / `build:steam:macos` / `build:steam:linux` も同じ処理を行い、
|
|
180
|
+
`--env prd` を指定済み。npm経由の引数は `-- --arch arm64` や `-- --env dev` で渡す。
|
|
181
|
+
|
|
182
|
+
既定の出力先は `dist/steam/<OS>/build/<env>/`。
|
|
183
|
+
|
|
184
|
+
| OS | 配布するフォルダ全体 | OS別DepotのExecutable | 共有DepotのExecutable |
|
|
185
|
+
|---|---|---|---|
|
|
186
|
+
| Windows | `My Game-win32-x64/` | `my-game.exe` | `windows/my-game.exe` |
|
|
187
|
+
| macOS | `My Game-darwin-universal/` | `My Game.app` | `macos/My Game.app` |
|
|
188
|
+
| Linux | `My Game-linux-x64/` | `my-game` | `linux/my-game` |
|
|
189
|
+
|
|
190
|
+
実際の起動パス・CPU・ContentRootは `*-steampipe/launch.json` を参照する。
|
|
191
|
+
実行ファイルだけでなく、Electronのライブラリ・locales・ライセンス・resourcesを含むフォルダ全体が配布対象。
|
|
192
|
+
Steam用のDMG/DEB/MSIは不要で、書き出し後に追加のアプリビルドは行わない。
|
|
193
|
+
|
|
194
|
+
別マシンやCIの成果物は、`steam-package.json` と `*-steampipe/` を含む各OSの `build/<env>/` を
|
|
195
|
+
同じ `dist/steam/<OS>/build/<env>/` 構成に集める。macOSのシンボリックリンクとLinuxの実行権限を保つため、
|
|
196
|
+
CI artifactは `tar.gz` にして転送する。カスタム出力先はSTEP6の `--steam-root` で指定する。
|
|
197
|
+
|
|
198
|
+
設定・バージョンを変えたら対象OSを再書き出しする。同じバージョン番号でも全OSを意図したリビジョンで揃える。
|
|
199
|
+
同じOSのx64とarm64を順に書き出すと、最後に成功したCPUの成果物を使う。
|
|
200
|
+
同じOSの複数CPUを1つの共有Depotへ同時に統合する処理は行わない。
|
|
201
|
+
|
|
202
|
+
配布用macOSアプリは署名・公証・staple完了を確認する(パスは成果物に合わせる):
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
codesign --verify --deep --strict --verbose=2 'dist/steam/macos/build/prd/My Game-darwin-universal/My Game.app'
|
|
206
|
+
echo $?
|
|
207
|
+
xcrun stapler validate 'dist/steam/macos/build/prd/My Game-darwin-universal/My Game.app'
|
|
208
|
+
echo $?
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
| 検証 | 正常時の出力 | 直後の `echo $?` |
|
|
212
|
+
| --- | --- | --- |
|
|
213
|
+
| `codesign --verify --deep --strict --verbose=2` | アプリのパスに続いて `valid on disk` と `satisfies its Designated Requirement` が表示される。内部コードの検証結果が追加で表示される場合もある。 | `0` |
|
|
214
|
+
| `xcrun stapler validate` | 最後に `The validate action worked!` が表示される。 | `0` |
|
|
215
|
+
|
|
216
|
+
`codesign` は `--verbose=2` を付けない場合、成功しても通常は何も表示しない。終了コードが `0` なら検証成功と判断できる。
|
|
217
|
+
`echo $?` は確認したいコマンドの直後に実行する。`0` 以外なら検証失敗なので、出力されたエラーを解消して再確認する。
|
|
218
|
+
これらは署名と添付済み公証チケットを検証するコマンドであり、署名・公証を実施する操作ではない。
|
|
219
|
+
両方が成功した後も、STEP6でSteamからのインストール・起動を確認する。
|
|
220
|
+
|
|
221
|
+
参考:[Appleの署名検証手順](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html)。
|
|
222
|
+
|
|
223
|
+
### STEP6:起動設定を反映し、アップロード・テストする
|
|
224
|
+
|
|
225
|
+
SteamworksのInstallation > General InstallationにOS別Launch Optionを追加する。
|
|
226
|
+
ExecutableはSTEP5の `launch.json` に合わせ、Arguments/Working Directoryは空欄にする。
|
|
227
|
+
x64版は64bit条件を指定する。対応OS・最低OS要件は同梱Electronと実機検証に合わせ、Steamworksで変更をPublishする。
|
|
228
|
+
|
|
229
|
+
ゲームルートで次を実行する。共有Depot・OS別Depotをまとめて1回のAppBuildでアップロードする。
|
|
230
|
+
Web/Electronの再ビルドや事前の `--steam-manifest` 実行は不要。
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
# ローカル検証のみ。SteamCMD・認証・Steamへの接続は不要
|
|
234
|
+
npx @next2d/builder --steam-upload --env prd --dry-run
|
|
235
|
+
|
|
236
|
+
# STEP4のSteamCMDログイン・正常終了後、同じターミナルで設定したブランチへアップロード
|
|
237
|
+
npx @next2d/builder --steam-upload --env prd
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
任意のアップロードコメントを付ける場合は `--steam-comment` を指定する。
|
|
241
|
+
Steamworksの「あなたのビルド」の説明(SteamPipeの `Desc`)に反映される。
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
npx @next2d/builder --steam-upload --env prd --steam-comment "内部テスト:ゲームパッド操作を修正"
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
| 引数・設定 | 用途 |
|
|
248
|
+
|---|---|
|
|
249
|
+
| `--steam-branch internal` | `steam.branch` の反映先を上書き。`SetLive` で反映を要求する。`default` は指定不可で、一般公開用ビルドの切り替えはSteamworksで行う。 |
|
|
250
|
+
| `--steam-comment "コメント"` | アップロードコメントを指定する。未指定時は従来どおり `<appName> <version> (<env>, <branch>)`。空白のみ・改行・制御文字・ダブルクォート・バックスラッシュは使用不可。`--dry-run` の出力と `upload-plan.json` でも確認できる。 |
|
|
251
|
+
| `--steam-root dist/steam` | 成果物の収集先。既定は `dist/steam`。ゲームルートからの相対パスまたは絶対パス。アップロード時はVite設定を読まないため、カスタム出力先では明示する。 |
|
|
252
|
+
| `--dry-run` | パッケージと設定の整合性を検証する。Steam側の権限・ブランチ・パスワードの確認は行わない。 |
|
|
253
|
+
| 併用しない引数 | `--build` / `--preview` / `--open` / `--steam-manifest` / `--arch`。`--platform` も不要。 |
|
|
254
|
+
|
|
255
|
+
対応するテンプレートのnpmスクリプトは `upload:steam:check` / `upload:steam`。
|
|
256
|
+
|
|
257
|
+
builderは `steam.depots` に設定された全OSの `steam-package.json` と実行ファイルを検証し、
|
|
258
|
+
App ID・Depot ID・バージョン・ゲーム名・CPUに不足や不整合があればSteamCMD起動前に停止する。
|
|
259
|
+
VDFは検証結果から再生成する。通常の書き出し用VDFは変更しない。
|
|
260
|
+
|
|
261
|
+
| 保存先(`--steam-root` 配下) | 内容 |
|
|
262
|
+
|---|---|
|
|
263
|
+
| `uploads/<env>/<branch>-<識別子>/` | VDF、`upload-plan.json`。dry-runは `Preview=1`、`SetLive`なし。アップロード成功時はBuildIDを `upload-result.json` に記録。 |
|
|
264
|
+
| `uploads/<env>/cache/<branch>/` | SteamPipeのログ・差分キャッシュ。 |
|
|
265
|
+
|
|
266
|
+
SteamworksのBuilds画面で、記録されたBuildIDが対象ブランチの現在のビルドになっていることを確認する。
|
|
267
|
+
アカウントやアプリの状態によってSteam側の追加確認が必要になる場合がある。
|
|
268
|
+
テスターはSteamクライアントのプロパティ > ゲームバージョンとベータでパスワードを入力し、`internal` を選ぶ。
|
|
269
|
+
各OSでインストール・起動を確認し、macOS UniversalはIntel / Apple Siliconの両方でテストする。
|
|
270
|
+
|
|
271
|
+
### 参照:VDFの生成と手動アップロード
|
|
272
|
+
|
|
273
|
+
builderのSTEP6を使う場合、この節の操作は不要。SteamCMDを直接操作する場合に使う。
|
|
274
|
+
|
|
275
|
+
| 構成 | 通常の書き出し時のVDF生成先・条件 |
|
|
276
|
+
|---|---|
|
|
277
|
+
| OS別Depot | 各OSの `*-steampipe/`。 |
|
|
278
|
+
| 共有Depot | 全対象OSが揃うと `dist/steam/shared/<env>/depot-<ID>/`。不足OSは `launch.json` に記録し、アップロード用VDF・OS単独VDFは生成しない。 |
|
|
279
|
+
|
|
280
|
+
一部OSだけDepot IDを共有する構成にも対応する。`FileMapping` でOS別サブディレクトリへ配置し、アセットは再コピーしない。
|
|
281
|
+
別マシンの成果物を集めた後に共有DepotのVDFだけを再生成する場合:
|
|
282
|
+
|
|
283
|
+
```sh
|
|
284
|
+
npx @next2d/builder --platform steam:macos --env prd --steam-manifest
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
npmの別名は `build:steam:manifest`(別環境なら `-- --env dev`)。このコマンドはどのOSでも実行でき、
|
|
288
|
+
`--platform` はVite設定を読むための指定で、設定内のすべての共有Depotを統合する。
|
|
289
|
+
`build.outDir` と `--env` から最新の成功した書き出しを選び、App ID・Depot ID・ゲーム名・実行ファイル名・バージョンを検証する。
|
|
290
|
+
不足パッケージは終了コード1となり、古い統合VDFは再生成時に無効化する。
|
|
291
|
+
`--arch` / `--preview` / `--build` / `--open` とは併用できない。
|
|
292
|
+
|
|
293
|
+
`app_preview.vdf` はファイルマッピング検証、`app_build.vdf` はアップロード、
|
|
294
|
+
`depot_build.vdf` はフォルダ内容の再帰マッピング用。`steam_appid.txt` は配布対象から除外する。
|
|
295
|
+
ContentRootはVDFからの相対パスなので、単独Depotはアプリと `*-steampipe/` をセットで、共有Depotは `dist/steam/` 全体の構成を保って移動する。
|
|
296
|
+
|
|
297
|
+
```text
|
|
298
|
+
steamcmd +login BUILD_ACCOUNT +run_app_build "/absolute/path/to/app_preview.vdf" +quit
|
|
299
|
+
steamcmd +login BUILD_ACCOUNT +run_app_build "/absolute/path/to/app_build.vdf" +quit
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
通常の書き出し・`--steam-manifest` のVDFには `SetLive` がないため、アップロード後にSteamworksで対象ブランチへ設定する。
|
|
303
|
+
OS別VDFは1つのDepotを更新するので、最終BuildのDepot manifestが全OSで意図した版になっているか確認する。
|
|
304
|
+
[SteamPipe公式手順・VDF仕様](https://partner.steamgames.com/doc/sdk/uploading)
|
|
305
|
+
|
|
306
|
+
### 参照:テンプレート・ホスト・移行
|
|
307
|
+
|
|
308
|
+
`create-next2d-app` はプロジェクト名から `appId`、`appName`、`executableName`、
|
|
309
|
+
`companyName` を設定する。例えば `my-game` なら `appId` は `app.example.my-game`、
|
|
310
|
+
他の3項目は `my-game` になる。配布前にbundle IDと会社名を自分の値へ変更する。
|
|
311
|
+
CPU設定が省略されている場合はOSごとの既定値を補い、テンプレートに指定済みの値は保持する。
|
|
312
|
+
アイコンパスやSteam IDなどの設定も保持する。
|
|
313
|
+
|
|
314
|
+
Electron用コードはbuilderが管理する。OSの一時ディレクトリにホスト・runtime設定・Web資産を配置し、失敗時を含め書き出し後に削除する。
|
|
315
|
+
ゲーム側へ `electron/`、Electron用 `node_modules` / lockfileは作らない。
|
|
316
|
+
Electronは `templates/electron/package.json`、Packagerは `src/tool-packages.ts` の固定バージョンを取得・キャッシュする。
|
|
317
|
+
PackagerはElectron書き出し時のみ取得し、OS別パッケージ・アイコン・署名・公証を処理する。
|
|
318
|
+
ホストにはnpm依存やネイティブアドオンがないため、ABIに合わせた再ビルドは不要。
|
|
319
|
+
プレビューは実行ホストのOS/CPUで書き出した `dist/<platform>/build/<env>/` のアプリを起動する。
|
|
320
|
+
|
|
321
|
+
旧 `electron/` のホストコード・`config.forge`・独自npm依存は参照しない。
|
|
322
|
+
移行時はアイコンを共通アセットへ移し、JSONのパスを更新してから旧ディレクトリを削除する。
|
|
323
|
+
独自main/preloadやネイティブアドオンがある場合は、先にbuilder側への対応が必要。
|
|
324
|
+
|
|
325
|
+
テンプレートのホストは絶対パスと固定origin `next2d://game` で資産を読む。
|
|
326
|
+
起動時の作業ディレクトリに依存せず、ローカルfetch・Worker・localStorageが使える。
|
|
327
|
+
F11/Alt+Enterで全画面、Escapeで解除。閉じるとmacOSでもプロセスを終了する。
|
|
328
|
+
Node integration無効・context isolation/sandbox有効、外部ページ遷移と新規ウィンドウは禁止。
|
|
329
|
+
Next2D用CSPを付与する。外部APIを使うゲームでは接続先を明示的に追加すること。
|
|
330
|
+
[Electron security](https://www.electronjs.org/docs/latest/tutorial/security) /
|
|
331
|
+
[protocol](https://www.electronjs.org/docs/latest/api/protocol)
|
|
332
|
+
|
|
333
|
+
保存先はElectronのappData配下の `appId` ディレクトリ。
|
|
334
|
+
表示名を変えても保存先は変わらない。旧file-originの開発版セーブは自動移行しない。
|
|
335
|
+
Steam Cloudは未統合。Chromiumプロファイル全体をCloud対象にせず、導入時は
|
|
336
|
+
ゲーム用のセーブファイルとアカウント単位の保存方式を別途設計する。
|
|
337
|
+
[Steam Cloud](https://partner.steamgames.com/doc/features/cloud)
|
|
338
|
+
|
|
339
|
+
### リリース前の確認範囲
|
|
340
|
+
|
|
341
|
+
STEP6のインストール・起動確認に加えて、以下を検証する。
|
|
342
|
+
|
|
343
|
+
- 終了動作、オフライン起動、更新後の保存データ。
|
|
344
|
+
- マウス/キーボード/コントローラ、解像度・全画面切替、音声、スリープ復帰。
|
|
345
|
+
- Shift+Tab Overlay。Electronは複数プロセスなので、OS/GPUごとに実動作を確認する。
|
|
346
|
+
この書き出しはSteamworks SDK・実績・DRM・Overlay APIを統合しない。
|
|
347
|
+
SDK統合はSteam配布の必須条件ではない。
|
|
348
|
+
- LinuxはSteam Linux Runtime環境で依存ライブラリとsandboxを確認する。
|
|
349
|
+
`--no-sandbox` を配布用の回避策にしない。
|
|
350
|
+
- Steam DeckのVerified判定は別審査。Linux版が生成できたことだけでは対応完了にならない。
|
|
351
|
+
コントローラだけで操作できること、文字の可読性、画面表示等を実機で確認する。
|
|
352
|
+
- Steamのビルド審査前に、ストアで宣言したOS・機能と動作が一致することを確認する。
|
|
353
|
+
|
|
354
|
+
[Steamworks API](https://partner.steamgames.com/doc/sdk/api) /
|
|
355
|
+
[Overlay](https://partner.steamgames.com/doc/features/overlay) /
|
|
356
|
+
[Linux開発](https://partner.steamgames.com/doc/store/application/platforms/linux) /
|
|
357
|
+
[Steam Deck互換性](https://partner.steamgames.com/doc/steamhardware/compat) /
|
|
358
|
+
[ビルド審査](https://partner.steamgames.com/doc/store/review_process)
|
|
359
|
+
|
|
360
|
+
## English
|
|
361
|
+
|
|
362
|
+
Local exports do not require Steamworks, SteamCMD or distribution signing credentials.
|
|
363
|
+
|
|
364
|
+
### STEP1: Prepare target environments and icons
|
|
365
|
+
|
|
366
|
+
- Build macOS Universal applications and perform macOS signing/notarization on macOS.
|
|
367
|
+
- Place Windows ICO, macOS ICNS and Linux PNG icons in `src/assets/icons/` in the Next2D Framework template.
|
|
368
|
+
Replace template placeholders before distribution. STEP3 documents omitted icon settings.
|
|
369
|
+
|
|
370
|
+
#### Supported operating systems and architectures
|
|
371
|
+
|
|
372
|
+
| OS | Default | Accepted `architectures` / `--arch` values |
|
|
373
|
+
|---|---|---|
|
|
374
|
+
| Windows | `x64` | `x64`, `arm64` |
|
|
375
|
+
| macOS | `universal` | `x64`, `arm64`, `universal` |
|
|
376
|
+
| Linux | `x64` | `x64`, `arm64` |
|
|
377
|
+
|
|
378
|
+
### STEP2: Prepare the Steamworks app, depots and testing branch (Steam distribution)
|
|
379
|
+
|
|
380
|
+
1. Find the issued App ID in the app's Steamworks administration page.
|
|
381
|
+
2. Create depots in SteamPipe > Depots and select their operating systems. Use All languages for shared language content,
|
|
382
|
+
save with Save Changes, then apply the changes on the Publish tab.
|
|
383
|
+
Include the required depots in development, testing and retail Packages. **Use actual Depot IDs; do not infer them from the App ID.**
|
|
384
|
+
3. Create an `internal` branch in SteamPipe > Builds and **set a password shared only with the intended testers.**
|
|
385
|
+
The name alone does not make it private. The builder does not create branches, configure passwords or verify protection.
|
|
386
|
+
4. Give testers access to the game and its depots. For external testers of an unreleased game, use Release State Override
|
|
387
|
+
(beta) keys or another appropriate method. A branch password alone does not grant game access.
|
|
388
|
+
Keep the password out of JSON and the repository, and ask testers not to share it with others.
|
|
389
|
+
|
|
390
|
+
#### Multiple depots and builder support
|
|
391
|
+
|
|
392
|
+
**Steam supports multiple depots under one App ID.** Valve recommends separate depots for OS-specific files.
|
|
393
|
+
|
|
394
|
+
| Configuration | Steam | Current builder |
|
|
395
|
+
|---|---|---|
|
|
396
|
+
| Separate depots for Windows / macOS / Linux | Supported. Set the target OS for each depot. | Supported. Assign different issued IDs to the OS entries in `steam.depots`. |
|
|
397
|
+
| One depot containing multiple operating systems | Supported. Set its OS selection accordingly, such as All OSes. | Supported. Assign the same ID to those operating systems. Files are placed in OS subdirectories. Distributing every included OS's files increases download size. |
|
|
398
|
+
| Only some operating systems share a depot | Supported. | Supported. Assign the same ID only to those operating systems. |
|
|
399
|
+
| Multiple depots for one OS, such as the application, common assets and languages | Supported. Their contents are combined during installation. | Not supported. Each OS accepts a single Depot ID; arrays and extra asset keys are not supported. |
|
|
400
|
+
|
|
401
|
+
The builder accepts one ID per OS, for a maximum of three distinct IDs overall. This is a limit of the builder's configuration format, not a Steam limit.
|
|
402
|
+
See STEP5 for collecting OS packages and launch paths, and STEP6 for uploading multiple depots in one operation.
|
|
403
|
+
|
|
404
|
+
Steam selects downloads based on Package ownership and depot conditions such as OS and language.
|
|
405
|
+
If simultaneously installed depots contain the same path, the depot later in the list takes priority, so check file placement.
|
|
406
|
+
Configure these selection conditions in Steamworks; the builder's JSON does not apply them.
|
|
407
|
+
|
|
408
|
+
`internal` / `beta` are branches that select an app build; separate depots are not required for each branch.
|
|
409
|
+
In this document, a "shared depot" groups multiple operating systems within the same app.
|
|
410
|
+
Steamworks' "Add Shared Depot" references a depot from another app; it is a separate operation from assigning the same ID in the builder.
|
|
411
|
+
|
|
412
|
+
[Depot configuration](https://partner.steamgames.com/doc/store/application/depots) /
|
|
413
|
+
[Packages and access](https://partner.steamgames.com/doc/store/application/packages) /
|
|
414
|
+
[Uploading multiple depots](https://partner.steamgames.com/doc/sdk/uploading) /
|
|
415
|
+
[Beta branches](https://partner.steamgames.com/doc/store/application/branches) /
|
|
416
|
+
[Testing on Steam](https://partner.steamgames.com/doc/store/testing) /
|
|
417
|
+
[Release State Override keys](https://partner.steamgames.com/doc/features/keys)
|
|
418
|
+
|
|
419
|
+
### STEP3: Configure electron.config.json
|
|
420
|
+
|
|
421
|
+
Manage game-specific settings in `electron.config.json` at the project root.
|
|
422
|
+
Both JavaScript and TypeScript templates include it; replace the defaults with your game's values.
|
|
423
|
+
`appId` is the macOS bundle ID and the identifier used for the save location; `steam.appId` is Valve's numeric App ID.
|
|
424
|
+
These are separate identifiers. The game version comes from the root `package.json`.
|
|
425
|
+
|
|
426
|
+
```json
|
|
427
|
+
{
|
|
428
|
+
"appId": "app.example.game",
|
|
429
|
+
"appName": "My Game",
|
|
430
|
+
"executableName": "my-game",
|
|
431
|
+
"companyName": "Example Company",
|
|
432
|
+
"icons": {
|
|
433
|
+
"windows": "src/assets/icons/icon.ico",
|
|
434
|
+
"macos": "src/assets/icons/icon.icns",
|
|
435
|
+
"linux": "src/assets/icons/icon.png"
|
|
436
|
+
},
|
|
437
|
+
"architectures": { "windows": "x64", "macos": "universal", "linux": "x64" },
|
|
438
|
+
"window": { "width": 1280, "height": 720, "fullscreen": false },
|
|
439
|
+
"steam": {
|
|
440
|
+
"appId": null,
|
|
441
|
+
"branch": "internal",
|
|
442
|
+
"depots": { "windows": null, "macos": null, "linux": null }
|
|
443
|
+
},
|
|
444
|
+
"macos": { "sign": false, "notarize": false }
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
| Field | Purpose / behavior | Defaults / notes |
|
|
449
|
+
|---|---|---|
|
|
450
|
+
| `companyName` | Company name in the Windows executable metadata. | Falls back to `author.name` in `package.json`, then to the game name. |
|
|
451
|
+
| `appName` / `executableName` | `appName` is the window and application name. `executableName` is the executable file name. | The display name and executable name can be set independently. |
|
|
452
|
+
| `description` | Optional description used in the generated Electron host's `package.json` and the Windows file description. | The JSON value takes priority. If omitted or `null`, uses `description` from the root `package.json`. If both are absent, uses an empty string. An explicit `""` also remains empty. |
|
|
453
|
+
| `icons` | Icon paths, relative to the project root or absolute. Use ICO for Windows, ICNS for macOS and PNG for Linux. | Each key is optional. Omitted platforms use the builder's placeholder Next2D icons; `"icons": {}` uses placeholders for every OS. A specified file that does not exist causes an error. |
|
|
454
|
+
| `architectures` | CPU architecture per OS. See STEP1 for supported operating systems and architectures. | Defaults to `x64` for Windows/Linux and `universal` for macOS. `--arch` takes priority. |
|
|
455
|
+
| `steam.appId` | Valve's numeric App ID. Set to `null` if it has not been issued. | Local exports still work without an App ID, but SteamPipe VDFs are not generated. |
|
|
456
|
+
| `steam.branch` | Target beta branch for `--steam-upload`. | Defaults to `internal`. `--steam-branch` takes priority. Create the branch and configure its password in Steamworks. |
|
|
457
|
+
| `steam.depots` | Actual Depot IDs created in Steamworks. Assigning the same ID to multiple operating systems combines them in one depot. | Do not infer Depot IDs from the App ID. If `null` or omitted, only the application and launch metadata are generated, without upload VDFs. |
|
|
458
|
+
| `macos` | macOS signing and notarization settings. | Use `false` for both `sign` / `notarize` during local testing. Enable both for production distribution. |
|
|
459
|
+
|
|
460
|
+
### STEP4: Prepare signing and upload credentials (distribution)
|
|
461
|
+
|
|
462
|
+
#### macOS signing and notarization
|
|
463
|
+
|
|
464
|
+
Install a Developer ID Application certificate and its matching private key in the macOS keychain, and save a notarization profile using
|
|
465
|
+
`xcrun notarytool store-credentials`. Do not put credentials in JSON.
|
|
466
|
+
|
|
467
|
+
Use the following command to find the signing identity to set as `APPLE_SIGNING_IDENTITY`:
|
|
468
|
+
|
|
469
|
+
```sh
|
|
470
|
+
security find-identity -v -p codesigning
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
Choose a valid `Developer ID Application: ...` identity from the output and use the entire name inside the double quotes
|
|
474
|
+
for `APPLE_SIGNING_IDENTITY`. Replace `YOUR NAME (TEAMID)` below with the actual value shown.
|
|
475
|
+
Setting the environment variable does not create a certificate.
|
|
476
|
+
|
|
477
|
+
```sh
|
|
478
|
+
export APPLE_SIGNING_IDENTITY='Developer ID Application: YOUR NAME (TEAMID)'
|
|
479
|
+
export APPLE_NOTARY_PROFILE='your-notary-profile'
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
For distribution, set both `macos.sign` / `macos.notarize` to `true`.
|
|
483
|
+
Alternatively, prefix the STEP5 macOS command with `NEXT2D_STEAM_RELEASE=1` to require both even when JSON specifies false.
|
|
484
|
+
Missing credentials, signing failures or notarization failures fail the build.
|
|
485
|
+
Signing failures stop before notarization. If the output shows `Signature=adhoc` / `TeamIdentifier=not set`,
|
|
486
|
+
the app lacks a Developer ID signature; check the preceding signing error and the certificate/private key in the keychain.
|
|
487
|
+
|
|
488
|
+
Steam uses the `darwin` target. Valve requires 64-bit support and Apple notarization for new macOS applications.
|
|
489
|
+
The template entitlements include library validation / DYLD settings for JIT and Steam Overlay,
|
|
490
|
+
without `com.apple.security.app-sandbox` (which is separate from Chromium's renderer sandbox).
|
|
491
|
+
[Valve platform requirements](https://partner.steamgames.com/doc/store/application/platforms) /
|
|
492
|
+
[Electron Packager signing and notarization options](https://electron.github.io/packager/main/interfaces/Options.html)
|
|
493
|
+
|
|
494
|
+
#### SteamCMD and the build account
|
|
495
|
+
|
|
496
|
+
Obtain SteamCMD for your host OS from the [Steamworks SDK ContentBuilder](https://partner.steamgames.com/doc/sdk/uploading).
|
|
497
|
+
Use `steamcmd.exe` on Windows or `steamcmd.sh` on macOS / Linux.
|
|
498
|
+
The builder uses `steamcmd` on PATH (`steamcmd.exe` on Windows), or the executable path set in `STEAMCMD`.
|
|
499
|
+
Specify only the path, without arguments or a shell command. A `.sh` file needs executable permission.
|
|
500
|
+
Install any OS libraries required by SteamCMD according to its setup instructions.
|
|
501
|
+
|
|
502
|
+
Grant the upload account `Edit App Metadata` and `Publish App Changes To Steam` permissions for the target app.
|
|
503
|
+
Example for macOS / Linux; replace the path and account name:
|
|
504
|
+
|
|
505
|
+
```sh
|
|
506
|
+
export STEAMCMD="/absolute/path/to/steamcmd.sh"
|
|
507
|
+
export STEAM_USERNAME="your_build_account"
|
|
508
|
+
"$STEAMCMD" +login "$STEAM_USERNAME" +quit
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
During the first login, enter the password and, if requested, the Steam Guard code interactively in SteamCMD.
|
|
512
|
+
After login succeeds, wait for `+quit` to exit normally and confirm that the regular terminal prompt has returned.
|
|
513
|
+
If you log in manually at the `Steam>` prompt, also enter `quit` before proceeding to upload.
|
|
514
|
+
The builder then reuses the saved login for the same SteamCMD installation and account without passing a password as a command-line argument.
|
|
515
|
+
Logging into the Steam desktop app alone does not confirm that this SteamCMD authentication setup is complete.
|
|
516
|
+
|
|
517
|
+
If uploading reports `Cached credentials not found` / `No cached credentials and @NoPromptForPassword is set`, or authentication expires,
|
|
518
|
+
rerun `"$STEAMCMD" +login "$STEAM_USERNAME" +quit` above, wait for it to exit normally, then retry the upload.
|
|
519
|
+
Builder uploads fail instead of waiting for interactive input, so retrying the builder alone cannot register login credentials.
|
|
520
|
+
In CI, restore and manage SteamCMD's `config/config.vdf` as a Secret and exclude it from build artifacts.
|
|
521
|
+
In Windows PowerShell, set `$env:STEAMCMD` and `$env:STEAM_USERNAME`.
|
|
522
|
+
|
|
523
|
+
### STEP5: Export each OS and collect the packages
|
|
524
|
+
|
|
525
|
+
Run the required OS commands from the game root. Exporting does not upload or publish anything.
|
|
526
|
+
|
|
527
|
+
```sh
|
|
528
|
+
npx @next2d/builder --platform steam:windows --env prd
|
|
529
|
+
npx @next2d/builder --platform steam:macos --env prd
|
|
530
|
+
npx @next2d/builder --platform steam:linux --env prd
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
Append an option such as `--arch arm64` to change the architecture.
|
|
534
|
+
Template scripts `npm run build:steam:windows` / `build:steam:macos` / `build:steam:linux` perform the same operations
|
|
535
|
+
and already specify `--env prd`. Pass npm arguments with `-- --arch arm64` or `-- --env dev`.
|
|
536
|
+
|
|
537
|
+
The default output location is `dist/steam/<OS>/build/<env>/`.
|
|
538
|
+
|
|
539
|
+
| OS | Entire folder to distribute | Separate depot Executable | Shared depot Executable |
|
|
540
|
+
|---|---|---|---|
|
|
541
|
+
| Windows | `My Game-win32-x64/` | `my-game.exe` | `windows/my-game.exe` |
|
|
542
|
+
| macOS | `My Game-darwin-universal/` | `My Game.app` | `macos/My Game.app` |
|
|
543
|
+
| Linux | `My Game-linux-x64/` | `my-game` | `linux/my-game` |
|
|
544
|
+
|
|
545
|
+
Read the actual launch path, architecture and ContentRoot from `*-steampipe/launch.json`.
|
|
546
|
+
Distribute the entire folder, including Electron libraries, locales, licenses and resources.
|
|
547
|
+
Steam needs no DMG/DEB/MSI installer, and no additional application build is required after export.
|
|
548
|
+
|
|
549
|
+
For separate machines or CI, collect each OS's `build/<env>/`, including `steam-package.json` and `*-steampipe/`,
|
|
550
|
+
under the same `dist/steam/<OS>/build/<env>/` layout. Transfer CI artifacts as `tar.gz` to preserve macOS symlinks
|
|
551
|
+
and Linux executable permissions. Use STEP6's `--steam-root` for a custom output location.
|
|
552
|
+
|
|
553
|
+
Re-export affected operating systems after changing configuration or version. Even with an unchanged version number,
|
|
554
|
+
keep all OS packages on the intended revision. When exporting x64 and arm64 successively for one OS, the last successful
|
|
555
|
+
architecture is used. Combining multiple architectures of one OS into a shared depot is not supported.
|
|
556
|
+
|
|
557
|
+
Verify signing, notarization and stapling for macOS distribution packages (adjust the paths):
|
|
558
|
+
|
|
559
|
+
```sh
|
|
560
|
+
codesign --verify --deep --strict --verbose=2 'dist/steam/macos/build/prd/My Game-darwin-universal/My Game.app'
|
|
561
|
+
echo $?
|
|
562
|
+
xcrun stapler validate 'dist/steam/macos/build/prd/My Game-darwin-universal/My Game.app'
|
|
563
|
+
echo $?
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
| Check | Successful output | Immediately following `echo $?` |
|
|
567
|
+
| --- | --- | --- |
|
|
568
|
+
| `codesign --verify --deep --strict --verbose=2` | The app path followed by `valid on disk` and `satisfies its Designated Requirement`. Additional results for nested code may also appear. | `0` |
|
|
569
|
+
| `xcrun stapler validate` | Ends with `The validate action worked!`. | `0` |
|
|
570
|
+
|
|
571
|
+
Without `--verbose=2`, `codesign` normally prints nothing on success. An exit code of `0` indicates that verification passed.
|
|
572
|
+
Run `echo $?` immediately after each command you want to check. A nonzero exit code means verification failed; resolve the reported error and check again.
|
|
573
|
+
These commands verify the signature and the attached notarization ticket; they do not sign or notarize the app.
|
|
574
|
+
After both checks pass, still verify installation and launching through Steam in STEP6.
|
|
575
|
+
|
|
576
|
+
Reference: [Apple's signature verification instructions](https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html).
|
|
577
|
+
|
|
578
|
+
### STEP6: Configure launching, upload and test
|
|
579
|
+
|
|
580
|
+
Add OS-specific Launch Options in Steamworks under Installation > General Installation.
|
|
581
|
+
Use the Executable from STEP5's `launch.json`, leaving Arguments/Working Directory empty.
|
|
582
|
+
Set the 64-bit condition for x64. Match supported OS versions and minimum requirements to the bundled Electron and hardware testing,
|
|
583
|
+
then Publish the Steamworks changes.
|
|
584
|
+
|
|
585
|
+
Run these commands from the game root. Shared and separate depots are uploaded together in a single AppBuild.
|
|
586
|
+
No Web/Electron rebuild or prior `--steam-manifest` command is needed.
|
|
587
|
+
|
|
588
|
+
```sh
|
|
589
|
+
# Local validation only: no SteamCMD, credentials or Steam connection required
|
|
590
|
+
npx @next2d/builder --steam-upload --env prd --dry-run
|
|
591
|
+
|
|
592
|
+
# After STEP4's SteamCMD login exits normally, upload to the configured branch in the same terminal
|
|
593
|
+
npx @next2d/builder --steam-upload --env prd
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
Use `--steam-comment` to set an optional upload comment.
|
|
597
|
+
It appears as the description under "Your Builds" in Steamworks (SteamPipe's `Desc`).
|
|
598
|
+
|
|
599
|
+
```sh
|
|
600
|
+
npx @next2d/builder --steam-upload --env prd --steam-comment "Internal test: fix gamepad controls"
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
| Option / setting | Purpose |
|
|
604
|
+
|---|---|
|
|
605
|
+
| `--steam-branch internal` | Overrides `steam.branch`; requests activation through `SetLive`. `default` is not allowed. Switch public release builds through Steamworks. |
|
|
606
|
+
| `--steam-comment "Comment"` | Sets the upload comment. If omitted, keeps the existing `<appName> <version> (<env>, <branch>)` format. Whitespace-only text, newlines, control characters, double quotes and backslashes are not allowed. Also shown in `--dry-run` output and `upload-plan.json`. |
|
|
607
|
+
| `--steam-root dist/steam` | Collected package location; defaults to `dist/steam`. Accepts an absolute path or a path relative to the game root. Specify custom output locations because uploading does not read the Vite configuration. |
|
|
608
|
+
| `--dry-run` | Validates packages against configuration. Does not check Steam permissions, branches or passwords. |
|
|
609
|
+
| Incompatible options | `--build` / `--preview` / `--open` / `--steam-manifest` / `--arch`. `--platform` is also unnecessary. |
|
|
610
|
+
|
|
611
|
+
The corresponding template npm scripts are `upload:steam:check` / `upload:steam`.
|
|
612
|
+
|
|
613
|
+
The builder checks `steam-package.json` and executables for every OS configured in `steam.depots`.
|
|
614
|
+
Missing or inconsistent App IDs, Depot IDs, versions, game names or architectures stop the operation before SteamCMD starts.
|
|
615
|
+
VDFs are regenerated from validated packages; ordinary export VDFs remain unchanged.
|
|
616
|
+
|
|
617
|
+
| Location (under `--steam-root`) | Contents |
|
|
618
|
+
|---|---|
|
|
619
|
+
| `uploads/<env>/<branch>-<identifier>/` | VDFs and `upload-plan.json`. Dry runs use `Preview=1` without `SetLive`. Successful uploads record the BuildID in `upload-result.json`. |
|
|
620
|
+
| `uploads/<env>/cache/<branch>/` | SteamPipe logs and incremental upload cache. |
|
|
621
|
+
|
|
622
|
+
On the Steamworks Builds page, verify that the recorded BuildID is the target branch's current build.
|
|
623
|
+
Steam may request additional confirmation depending on the account or app state.
|
|
624
|
+
Testers enter the password and select `internal` in the Steam client's Properties > Game Versions & Betas.
|
|
625
|
+
Verify installation and launch on each OS, including both Intel and Apple Silicon for macOS Universal.
|
|
626
|
+
|
|
627
|
+
### Reference: VDF generation and manual uploading
|
|
628
|
+
|
|
629
|
+
Skip these operations when using the builder in STEP6. This section is for direct SteamCMD use.
|
|
630
|
+
|
|
631
|
+
| Layout | VDF output and conditions during ordinary export |
|
|
632
|
+
|---|---|
|
|
633
|
+
| Separate OS depots | Each OS's `*-steampipe/` directory. |
|
|
634
|
+
| Shared depots | `dist/steam/shared/<env>/depot-<ID>/` once all required OS packages exist. Missing operating systems are listed in `launch.json`; neither upload VDFs nor standalone per-OS VDFs are generated for an incomplete group. |
|
|
635
|
+
|
|
636
|
+
Some operating systems may share a Depot ID while others use separate depots. `FileMapping` assigns OS subdirectories without copying assets again.
|
|
637
|
+
To regenerate only shared depot VDFs after collecting packages from separate machines:
|
|
638
|
+
|
|
639
|
+
```sh
|
|
640
|
+
npx @next2d/builder --platform steam:macos --env prd --steam-manifest
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
The npm alias is `build:steam:manifest` (append `-- --env dev` for another environment). This command runs on any OS.
|
|
644
|
+
`--platform` selects the Vite configuration; all configured shared depots are combined.
|
|
645
|
+
It selects the last successful exports using `build.outDir` and `--env`, validating the App ID, Depot IDs, game name, executable name and version.
|
|
646
|
+
Missing packages cause exit code 1. Old combined VDFs are invalidated during regeneration.
|
|
647
|
+
Do not combine this command with `--arch` / `--preview` / `--build` / `--open`.
|
|
648
|
+
|
|
649
|
+
`app_preview.vdf` validates file mappings, `app_build.vdf` uploads, and `depot_build.vdf` recursively maps folder contents.
|
|
650
|
+
`steam_appid.txt` is excluded from distribution. ContentRoot is relative to the VDF, so move a standalone depot's application
|
|
651
|
+
and `*-steampipe/` together; preserve the whole `dist/steam/` layout for shared depots.
|
|
652
|
+
|
|
653
|
+
```text
|
|
654
|
+
steamcmd +login BUILD_ACCOUNT +run_app_build "/absolute/path/to/app_preview.vdf" +quit
|
|
655
|
+
steamcmd +login BUILD_ACCOUNT +run_app_build "/absolute/path/to/app_build.vdf" +quit
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
Ordinary exports and `--steam-manifest` omit `SetLive`; assign the uploaded build to its branch through Steamworks.
|
|
659
|
+
Each per-OS VDF updates one depot, so verify the final Build references the intended manifest version for every OS.
|
|
660
|
+
[Official SteamPipe workflow and VDF specification](https://partner.steamgames.com/doc/sdk/uploading)
|
|
661
|
+
|
|
662
|
+
### Reference: Templates, host and migration
|
|
663
|
+
|
|
664
|
+
`create-next2d-app` initializes `appId`, `appName`, `executableName` and `companyName` from the project name.
|
|
665
|
+
For example, `my-game` produces `app.example.my-game` for `appId` and `my-game` for the other three fields.
|
|
666
|
+
Replace the bundle ID and company name with your own values before distribution.
|
|
667
|
+
Missing CPU settings receive the defaults for each OS; values already provided by the template are preserved.
|
|
668
|
+
Other settings, such as icon paths and Steam IDs, are also preserved.
|
|
669
|
+
|
|
670
|
+
The builder manages Electron host code. It stages the host, runtime configuration and web assets in an OS temporary directory,
|
|
671
|
+
then removes it after export, including failures. No `electron/`, Electron-specific `node_modules` or lockfile is created in the game.
|
|
672
|
+
Electron is pinned in `templates/electron/package.json`; Packager is pinned in `src/tool-packages.ts`. Both are downloaded and cached.
|
|
673
|
+
Packager is acquired only for Electron exports and handles OS packages, icons, signing and notarization.
|
|
674
|
+
The host has no npm dependencies or native addons, so ABI-specific rebuilding is unnecessary.
|
|
675
|
+
Preview exports for the host OS/CPU and launches the application under `dist/<platform>/build/<env>/`.
|
|
676
|
+
|
|
677
|
+
Legacy `electron/` host code, `config.forge` and custom npm dependencies are not used.
|
|
678
|
+
For migration, move icons into shared assets and update their JSON paths before deleting the old directory.
|
|
679
|
+
Custom main/preload code or native addons require builder support before migration.
|
|
680
|
+
|
|
681
|
+
The template host loads assets using absolute paths and the fixed origin `next2d://game`.
|
|
682
|
+
Local fetch, Workers and localStorage work independently of the startup working directory.
|
|
683
|
+
F11/Alt+Enter enters fullscreen; Escape exits it. Closing the window also terminates the process on macOS.
|
|
684
|
+
Node integration is disabled, context isolation and sandboxing are enabled, and external navigation and new windows are blocked.
|
|
685
|
+
A Next2D CSP is applied. Games using external APIs must explicitly add their destinations.
|
|
686
|
+
[Electron security](https://www.electronjs.org/docs/latest/tutorial/security) /
|
|
687
|
+
[protocol](https://www.electronjs.org/docs/latest/api/protocol)
|
|
688
|
+
|
|
689
|
+
Save data is stored in the `appId` directory under Electron's appData location.
|
|
690
|
+
Changing the display name does not change that location. Saves from older file-origin development builds are not migrated automatically.
|
|
691
|
+
Steam Cloud is not integrated. When adding it, design game-specific save files and per-account storage separately,
|
|
692
|
+
rather than syncing the entire Chromium profile.
|
|
693
|
+
[Steam Cloud](https://partner.steamgames.com/doc/features/cloud)
|
|
694
|
+
|
|
695
|
+
### Pre-release validation
|
|
696
|
+
|
|
697
|
+
In addition to STEP6's installation and launch checks, verify:
|
|
698
|
+
|
|
699
|
+
- Exit behavior, offline launch and saved data after updates.
|
|
700
|
+
- Mouse/keyboard/controller input, resolution and fullscreen switching, audio and sleep/resume.
|
|
701
|
+
- Shift+Tab Overlay. Electron uses multiple processes, so verify actual behavior on each OS/GPU.
|
|
702
|
+
This export does not integrate the Steamworks SDK, achievements, DRM or Overlay APIs.
|
|
703
|
+
SDK integration is not required for Steam distribution.
|
|
704
|
+
- On Linux, check dependent libraries and sandboxing in the Steam Linux Runtime environment.
|
|
705
|
+
Do not use `--no-sandbox` as a distribution workaround.
|
|
706
|
+
- Steam Deck Verified requires a separate review. Producing a Linux package alone does not establish compatibility.
|
|
707
|
+
Test controller-only operation, text readability and display behavior on hardware.
|
|
708
|
+
- Before Steam's build review, verify that the supported operating systems and features advertised on the store match the application.
|
|
709
|
+
|
|
710
|
+
[Steamworks API](https://partner.steamgames.com/doc/sdk/api) /
|
|
711
|
+
[Overlay](https://partner.steamgames.com/doc/features/overlay) /
|
|
712
|
+
[Linux development](https://partner.steamgames.com/doc/store/application/platforms/linux) /
|
|
713
|
+
[Steam Deck compatibility](https://partner.steamgames.com/doc/steamhardware/compat) /
|
|
714
|
+
[Build review](https://partner.steamgames.com/doc/store/review_process)
|