Skip to content

Commit 94bd630

Browse files
committed
chore: Update publish workflow to use environment variable for pub token
This commit modifies the GitHub Actions workflow for publishing packages by removing the setup of pub credentials and instead using an environment variable for the PUB_TOKEN. This change simplifies the workflow and enhances security by leveraging GitHub secrets for authentication during the publishing process.
1 parent 1291dae commit 94bd630

9 files changed

Lines changed: 220 additions & 30 deletions

File tree

.github/workflows/publish.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ on:
77
workflow_dispatch:
88
inputs:
99
package:
10-
description: 'Package to publish (all, gameframework, gameframework_unity, gameframework_unreal)'
10+
description: 'Package to publish (all, gameframework, gameframework_unity, gameframework_unreal, gameframework_stream)'
1111
required: true
1212
default: 'all'
1313
type: choice
1414
options:
1515
- all
1616
- gameframework
17+
- gameframework_stream
1718
- gameframework_unity
1819
- gameframework_unreal
1920
dry_run:
@@ -35,6 +36,8 @@ jobs:
3536
package:
3637
- name: gameframework
3738
path: packages/gameframework
39+
- name: gameframework_stream
40+
path: packages/gameframework_stream
3841
- name: gameframework_unity
3942
path: engines/unity/dart
4043
- name: gameframework_unreal
@@ -90,12 +93,6 @@ jobs:
9093
working-directory: packages/gameframework
9194
run: flutter pub get
9295

93-
- name: Setup pub credentials
94-
if: github.event.inputs.dry_run != 'true'
95-
run: |
96-
mkdir -p $HOME/.pub-cache
97-
echo '${{ secrets.PUB_CREDENTIALS }}' > $HOME/.pub-cache/credentials.json
98-
9996
- name: Publish to pub.dev (dry-run)
10097
if: github.event.inputs.dry_run == 'true'
10198
working-directory: packages/gameframework
@@ -104,7 +101,9 @@ jobs:
104101
- name: Publish to pub.dev
105102
if: github.event.inputs.dry_run != 'true'
106103
working-directory: packages/gameframework
107-
run: flutter pub publish --force
104+
run: dart pub token add https://pub.dev --env-var PUB_TOKEN && flutter pub publish --force
105+
env:
106+
PUB_TOKEN: ${{ secrets.PUB_TOKEN }}
108107

109108
- name: Extract version
110109
if: github.event.inputs.dry_run != 'true'
@@ -115,15 +114,15 @@ jobs:
115114
echo "version=$VERSION" >> $GITHUB_OUTPUT
116115
echo "Published gameframework v$VERSION"
117116
118-
# Publish engine plugins after core package
117+
# Publish dependent packages after core package (stream, engine plugins)
119118
# matrix is NOT available in job-level `if`, so per-package filtering
120119
# is handled at the step level via the should_publish check.
121-
publish-engine-plugins:
120+
publish-dependent-packages:
122121
name: Publish ${{ matrix.package.name }}
123122
needs: [validate, publish-gameframework]
124123
runs-on: ubuntu-latest
125124
# always() is required so this job isn't auto-skipped when publish-gameframework is skipped
126-
# (e.g. when dispatching for a single engine plugin only).
125+
# (e.g. when dispatching for a single dependent package only).
127126
# We gate on validate succeeding and publish-gameframework not having failed.
128127
if: |
129128
always() &&
@@ -136,6 +135,8 @@ jobs:
136135
strategy:
137136
matrix:
138137
package:
138+
- name: gameframework_stream
139+
path: packages/gameframework_stream
139140
- name: gameframework_unity
140141
path: engines/unity/dart
141142
- name: gameframework_unreal
@@ -218,14 +219,14 @@ jobs:
218219
# Create GitHub release on tag push after all packages are published
219220
create-release:
220221
name: Create GitHub Release
221-
needs: [publish-gameframework, publish-engine-plugins]
222+
needs: [publish-gameframework, publish-dependent-packages]
222223
runs-on: ubuntu-latest
223224
if: |
224225
always() &&
225226
github.event_name == 'push' &&
226227
startsWith(github.ref, 'refs/tags/v') &&
227228
needs.publish-gameframework.result == 'success' &&
228-
needs.publish-engine-plugins.result == 'success'
229+
needs.publish-dependent-packages.result == 'success'
229230
steps:
230231
- name: Checkout repository
231232
uses: actions/checkout@v4
@@ -256,9 +257,10 @@ jobs:
256257
## Flutter Game Framework ${{ steps.tag_version.outputs.version }}
257258
258259
Published packages:
259-
- [gameframework](https://pub.dev/packages/gameframework)
260-
- [gameframework_unity](https://pub.dev/packages/gameframework_unity)
261-
- [gameframework_unreal](https://pub.dev/packages/gameframework_unreal)
260+
- [gameframework](https://pub.dev/packages/gameframework) - Core framework
261+
- [gameframework_stream](https://pub.dev/packages/gameframework_stream) - Asset streaming
262+
- [gameframework_unity](https://pub.dev/packages/gameframework_unity) - Unity integration
263+
- [gameframework_unreal](https://pub.dev/packages/gameframework_unreal) - Unreal integration
262264
263265
### Changelog
264266
${{ steps.changelog.outputs.changelog }}

engines/unity/dart/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Unity Engine Plugin for Flutter Game Framework
1+
# Unity Engine Plugin for Game Framework
22

3-
Unity Engine integration plugin for the Flutter Game Framework. This plugin allows you to embed Unity games in your Flutter applications with a unified API.
3+
Unity Engine integration plugin for Game Framework. This plugin allows you to embed Unity games in your Flutter applications with a unified API.
44

55
## Features
66

engines/unreal/dart/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Unreal Engine Plugin for Flutter Game Framework
1+
# Unreal Engine Plugin for Game Framework
22

33
[![pub package](https://img.shields.io/pub/v/gameframework_unreal.svg)](https://pub.dev/packages/gameframework_unreal)
44
[![Platform](https://img.shields.io/badge/platform-Android%20%7C%20iOS%20%7C%20macOS%20%7C%20Windows%20%7C%20Linux-blue.svg)](https://pub.dev/packages/gameframework_unreal)

packages/gameframework/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Flutter Game Framework
1+
# Game Framework
22

33
A unified, modular framework for embedding multiple game engines (Unity, Unreal Engine, and potentially others) into Flutter applications.
44

@@ -307,13 +307,6 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
307307

308308
---
309309

310-
## 🙏 Acknowledgments
311-
312-
- Inspired by [flutter-unity-view-widget](https://github.com/juicycleff/flutter-unity-view-widget)
313-
- Built with ❤️ for the Flutter and game development communities
314-
315-
---
316-
317310
## 📞 Support
318311

319312
- **Issues:** [GitHub Issues](https://github.com/xraph/gameframework/issues)
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Changelog
2+
3+
All notable changes to the gameframework_stream package will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.0.1] - 2026-02-06
9+
10+
### Initial Release
11+
12+
Asset streaming support for Flutter Game Framework. Enables on-demand downloading of Unity Addressable assets from GameFramework Cloud.
13+
14+
#### Core Features
15+
16+
**Asset Streaming:**
17+
- On-demand asset downloading from remote servers
18+
- Support for Unity Addressables integration
19+
- Asset bundle management and caching
20+
- Bandwidth-aware streaming with quality adaptation
21+
- Resume capability for interrupted downloads
22+
- Progress tracking and reporting
23+
24+
**Cache Management:**
25+
- Local asset cache with configurable size limits
26+
- LRU (Least Recently Used) eviction strategy
27+
- Cache persistence across app sessions
28+
- Manual cache clearing APIs
29+
- Cache statistics and monitoring
30+
31+
**Network Optimization:**
32+
- Automatic quality adjustment based on connection speed
33+
- Chunked downloads with retry logic
34+
- Concurrent download management
35+
- Bandwidth throttling options
36+
- Connection type awareness (WiFi vs Cellular)
37+
38+
**API:**
39+
- `StreamingAssetManager` - Main asset streaming controller
40+
- `AssetDownloadRequest` - Request model for asset downloads
41+
- `StreamingConfig` - Configuration for streaming behavior
42+
- `CacheConfig` - Cache size and policy configuration
43+
- Event streams for download progress and completion
44+
45+
**Integration:**
46+
- Seamless integration with `gameframework` core package
47+
- Compatible with Unity Addressables workflow
48+
- Works with GameFramework Cloud CDN
49+
- Platform-agnostic implementation
50+
51+
#### Technical Specifications
52+
53+
**Dependencies:**
54+
```yaml
55+
dependencies:
56+
gameframework: ^0.0.1
57+
http: ^1.2.0
58+
path_provider: ^2.1.1
59+
crypto: ^3.0.3
60+
connectivity_plus: ^6.0.0
61+
```
62+
63+
**Supported Platforms:**
64+
- Android (API 21+)
65+
- iOS (12.0+)
66+
- macOS (10.14+)
67+
- Windows (10+)
68+
- Linux (Ubuntu 20.04+)
69+
- Web (with limitations)
70+
71+
#### Usage Example
72+
73+
```dart
74+
import 'package:gameframework_stream/gameframework_stream.dart';
75+
76+
// Initialize streaming manager
77+
final manager = StreamingAssetManager(
78+
config: StreamingConfig(
79+
baseUrl: 'https://cdn.gameframework.cloud',
80+
maxCacheSizeMB: 500,
81+
enableBackgroundDownloads: true,
82+
),
83+
);
84+
85+
// Download an asset
86+
await manager.downloadAsset(
87+
AssetDownloadRequest(
88+
assetId: 'level_001',
89+
bundleName: 'levels.bundle',
90+
),
91+
onProgress: (progress) {
92+
print('Download progress: ${progress * 100}%');
93+
},
94+
);
95+
96+
// Load downloaded asset
97+
final assetPath = await manager.getAssetPath('level_001');
98+
```
99+
100+
#### Features
101+
102+
**Quality Adaptation:**
103+
- Automatic quality selection based on network speed
104+
- Manual quality override options
105+
- Progressive quality enhancement
106+
107+
**Download Management:**
108+
- Priority-based download queue
109+
- Pause/resume support
110+
- Background download capability
111+
- Batch download operations
112+
113+
**Error Handling:**
114+
- Automatic retry with exponential backoff
115+
- Network error recovery
116+
- Disk space monitoring
117+
- Graceful degradation
118+
119+
**Monitoring:**
120+
- Real-time download progress
121+
- Cache utilization metrics
122+
- Network bandwidth usage
123+
- Download history tracking
124+
125+
#### Breaking Changes
126+
127+
None - Initial release.
128+
129+
#### Known Limitations
130+
131+
- Web platform has limited cache persistence
132+
- Background downloads require platform-specific permissions
133+
- Maximum concurrent downloads: 3 (configurable)
134+
135+
---
136+
137+
## [Unreleased]
138+
139+
### Planned Features
140+
141+
**v0.1.0 - Enhanced Streaming:**
142+
- Differential asset updates
143+
- P2P asset sharing (experimental)
144+
- Advanced prefetching strategies
145+
- Custom CDN integrations
146+
147+
**v0.2.0 - Analytics:**
148+
- Detailed streaming analytics
149+
- User behavior insights
150+
- Performance profiling
151+
- A/B testing support
152+
153+
**v0.3.0 - Advanced Features:**
154+
- Multi-CDN failover
155+
- Regional content delivery
156+
- Asset version management
157+
- Content encryption support
158+
159+
**v1.0.0 - Production Release:**
160+
- Complete documentation
161+
- Production performance benchmarks
162+
- Enterprise features
163+
- SLA guarantees
164+
165+
---
166+
167+
## Links
168+
169+
- [GitHub Repository](https://github.com/xraph/gameframework)
170+
- [Issue Tracker](https://github.com/xraph/gameframework/issues)
171+
- [pub.dev Package](https://pub.dev/packages/gameframework_stream)
172+
173+
---
174+
175+
**Last Updated:** 2026-02-06
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Xraph
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/gameframework_stream/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GameFramework Stream
22

3-
Asset streaming support for Flutter Game Framework. Enables apps to ship with minimal base size and download Unity Addressable content at runtime from GameFramework Cloud.
3+
Asset streaming support for Game Framework. Enables apps to ship with minimal base size and download Unity Addressable content at runtime from GameFramework Cloud.
44

55
## Features
66

packages/gameframework_stream/lib/src/game_stream_controller.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:gameframework/gameframework.dart';
66

77
import 'cache_manager.dart';
88
import 'content_downloader.dart';
9-
import 'models/content_bundle.dart';
109
import 'models/content_manifest.dart';
1110
import 'models/download_progress.dart';
1211
import 'models/download_strategy.dart';

packages/gameframework_stream/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ resolution: workspace
2222
dependencies:
2323
flutter:
2424
sdk: flutter
25-
gameframework: 0.0.1
25+
gameframework: ^0.0.1
2626
http: ^1.2.0
2727
path_provider: ^2.1.1
2828
crypto: ^3.0.3

0 commit comments

Comments
 (0)