Package Management
Publishing Workflow
Complete workflow for publishing Flutter packages to Game Framework.
Pre-Publish Checklist
- Tests pass (
flutter test) - Analysis clean (
flutter analyze) - Version updated in pubspec.yaml
- CHANGELOG updated
- README complete
- LICENSE file present
- publish_to set correctly
Publishing Workflow
Prepare Package
# Run tests
flutter test
# Check for issues
flutter analyze
# Validate package
flutter pub publish --dry-runUpdate Version
# pubspec.yaml
version: 1.1.0 # Increment versionUpdate CHANGELOG.md:
## 1.1.0
- Added feature X
- Fixed bug YPublish
flutter pub publish --server=https://registry.yourcompany.comVerify
curl https://registry.yourcompany.com/v1/packages/my_package \
-H "Authorization: Bearer YOUR_TOKEN"Automated Publishing (CI/CD)
# .github/workflows/publish.yml
name: Publish
on:
push:
tags: ['v*']
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- run: flutter test
- run: flutter pub publish --force
env:
GF_PUB_TOKEN: ${{ secrets.GAME_FRAMEWORK_TOKEN }}See CI/CD Guide for details.
Publishing Best Practices
- Always test before publishing
- Use semantic versioning
- Document breaking changes
- Tag releases in Git
- Announce major updates
Next Steps
- Versioning - Version management
- CI/CD Integration - Automate publishing