game publish
Publish your Flutter package and game artifacts to Game Framework Cloud.
Usage
game publish [options]Options
| Option | Description | Default |
|---|---|---|
--workspace, -w | Override workspace ID | from config |
--api-url | Override API URL | from config |
--dry-run | Validate without publishing | false |
--skip-artifacts | Skip artifact uploads | false |
--platform | Specific platforms for artifacts | all enabled |
--auto-export | Auto-export artifacts if not found | true |
Publishing Workflow
graph TD
Start[game publish] --> Validate[Validate Project]
Validate --> Auth[Check Authentication]
Auth --> Workspace[Select/Validate Workspace]
Workspace --> Check[Check Version Exists]
Check --> Package[Build Package Archive]
Package --> Upload[Upload Package]
Upload --> Artifacts[Upload Artifacts]
Artifacts --> Finalize[Finalize Publication]
Finalize --> Success[Published Successfully]Examples
Basic Publishing
# Publish package and all artifacts
game publish
# Publish to specific workspace
game publish --workspace ws-abc123
# Dry run to validate
game publish --dry-runArtifact Control
# Publish package only (no artifacts)
game publish --skip-artifacts
# Publish with specific platforms
game publish --platform android --platform ios
# Publish without auto-export
game publish --auto-export=falseWhat Gets Published
Package Archive
The CLI creates a .tar.gz archive containing:
lib/- Dart source codeandroid/- Android plugin code (optional)ios/- iOS plugin code (optional)pubspec.yaml- Package metadataREADME.md- DocumentationLICENSE- License fileCHANGELOG.md- Change history
Artifacts
Game engine builds for enabled platforms:
- Android: Unity/Unreal Android builds
- iOS: Unity/Unreal iOS frameworks
- Desktop: macOS/Windows/Linux builds
Artifacts are chunked for efficient downloads.
Requirements
Before Publishing
- Authenticated: Run
game login - Workspace Selected: Run
game workspace select - Valid pubspec.yaml: Includes name and version
- Optional .game.yml: For artifact uploads
Version Requirements
- Follow semantic versioning (e.g., 1.0.0)
- Version must not already exist
- Increment version for each publish
Configuration
pubspec.yaml
name: my_game_package
version: 1.0.0
description: My awesome game package
dependencies:
gameframework: ^0.0.1
gameframework_unity: ^0.0.1.game.yml
name: my_game
version: 1.0.0
publish:
workspace_id: "ws-abc123"
package_name: "my_game" # Override pubspec name
private: false
exclude:
- "*.log"
- "temp/"
- "build/"
engines:
unity:
project_path: ./unity_project
export_path: ./unity_project/Exports
platforms:
android:
enabled: true
ios:
enabled: trueAuto-Export
If artifacts are missing, the CLI can automatically export them:
game publish # Automatically runs game export if neededDisable with:
game publish --auto-export=falseDry Run
Test your publish configuration without actually uploading:
game publish --dry-runThis validates:
- Authentication status
- Workspace access
- Package configuration
- Version availability
- Artifact presence
Always run --dry-run first to catch issues before publishing!
Troubleshooting
Not Authenticated
Error: Authentication required
Solution: Run game login
Workspace Not Selected
Error: No workspace selected
Solution: Run game workspace select
Version Already Exists
Error: Version 1.0.0 already exists
Solutions:
- Bump version in
pubspec.yaml - Use semantic versioning rules
- Check existing versions
Package Too Large
Error: Package exceeds size limit
Solutions:
- Add large files to
.game.ymlexclude list - Remove unnecessary files
- Check workspace storage quota
Artifact Upload Failed
Error: Failed to upload artifact for android
Solutions:
- Ensure artifact was exported:
game export unity --platform android - Check export path in
.game.yml - Verify file exists at export location
Best Practices
Version Management
- Bump version before each publish
- Follow semantic versioning
- Document changes in
CHANGELOG.md
Testing
- Test package locally before publishing
- Use
--dry-runto validate - Verify artifacts are exported correctly
Exclusions
Exclude unnecessary files:
publish:
exclude:
- "*.log"
- "temp/"
- "build/"
- ".dart_tool/"
- "*.iml"Private Packages
For internal packages:
publish:
private: trueCI/CD Integration
GitHub Actions
name: Publish Package
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Get dependencies
run: flutter pub get
- name: Login to Game Framework
run: game login --api-key ${{ secrets.GAME_API_KEY }}
- name: Publish package
run: game publish --workspace ${{ secrets.WORKSPACE_ID }}GitLab CI
publish:
stage: deploy
script:
- flutter pub get
- game login --api-key $GAME_API_KEY
- game publish --workspace $WORKSPACE_ID
only:
- tagsRelated Commands
game login- Authenticate firstgame workspace- Select workspacegame export- Export artifacts
Next Steps
After publishing:
- Verify publication - Check Game Framework web interface
- Test installation - Try installing in another project
- Share with team - Team members can now use the package
Package published successfully? Your team can now use it in their projects!