Game Framework
CLI ReferenceCommands

game publish

Publish your Flutter package and game artifacts to Game Framework Cloud.

Usage

game publish [options]

Options

OptionDescriptionDefault
--workspace, -wOverride workspace IDfrom config
--api-urlOverride API URLfrom config
--dry-runValidate without publishingfalse
--skip-artifactsSkip artifact uploadsfalse
--platformSpecific platforms for artifactsall enabled
--auto-exportAuto-export artifacts if not foundtrue

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-run

Artifact 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=false

What Gets Published

Package Archive

The CLI creates a .tar.gz archive containing:

  • lib/ - Dart source code
  • android/ - Android plugin code (optional)
  • ios/ - iOS plugin code (optional)
  • pubspec.yaml - Package metadata
  • README.md - Documentation
  • LICENSE - License file
  • CHANGELOG.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: true

Auto-Export

If artifacts are missing, the CLI can automatically export them:

game publish  # Automatically runs game export if needed

Disable with:

game publish --auto-export=false

Dry Run

Test your publish configuration without actually uploading:

game publish --dry-run

This 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.yml exclude 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

Testing

  • Test package locally before publishing
  • Use --dry-run to 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: true

CI/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:
    - tags

Next Steps

After publishing:

  1. Verify publication - Check Game Framework web interface
  2. Test installation - Try installing in another project
  3. Share with team - Team members can now use the package

Package published successfully? Your team can now use it in their projects!