Skip to content

Commit

Permalink
feat: Support transient identities and traits
Browse files Browse the repository at this point in the history
- Drop Flutter 2 support
- Publish via official Dart OIDC-enabled workflow
- Support transient identities and traits
- Integrate `flagsmith_core` and `flagsmith_storage_sharedpreferences`
- Minor unit test improvements
  • Loading branch information
khvn26 committed Oct 16, 2024
1 parent e620822 commit e0d0b9d
Show file tree
Hide file tree
Showing 52 changed files with 2,203 additions and 340 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/publish_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,25 @@ on:
tags:
- "*"

env:
FLUTTER_VERSION: '3.x'

jobs:
analyze:
runs-on: ubuntu-latest
name: Dart Analyze
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub get
- run: flutter analyze

# TODO https://github.com/Flagsmith/flagsmith-flutter-client/issues/57

publishing:
runs-on: ubuntu-latest
container:
image: google/dart:latest
name: Dart Publish Package
needs: analyze
steps:
- uses: actions/checkout@v1
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": 1649072931936
}
EOF
- name: Publish package
run: pub publish -f
publish:
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
24 changes: 12 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,33 @@ on:
- reopened
- ready_for_review

env:
FLUTTER_VERSION: '3.x'

jobs:
analyze:
runs-on: ubuntu-latest
name: Dart Analyze
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub get
- run: flutter analyze

tests:
runs-on: ubuntu-latest
name: Flutter Test
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'

flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub get
- run: flutter pub test
- run: flutter test

# TODO https://github.com/Flagsmith/flagsmith-flutter-client/issues/57

Expand All @@ -46,8 +48,6 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
channel: 'stable'

flutter-version: ${{ env.FLUTTER_VERSION }}
channel: stable
- run: flutter pub publish --dry-run

15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Changelog
## [6.0.0]

Breaking Changes:

- Drop Flutter 2 support

Features:

- Support transient identities and traits

Other:

- Integrate `flagsmith_core` and `flagsmith_storage_sharedpreferences`
- Minor unit test improvements

## [5.0.1]

- Change the base url to https://edge.api.flagsmith.com/api/v1/
Expand Down
1 change: 0 additions & 1 deletion example/lib/di.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flagsmith/flagsmith.dart';
import 'package:flagsmith_storage/flagsmith_storage_sharedpreferences.dart';
import 'package:get_it/get_it.dart';

import 'bloc/flag_bloc.dart';
Expand Down
1 change: 0 additions & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ ThemeData darkTheme(BuildContext context) {
secondary: Color(0xFFBFA6E9),
secondaryContainer: Color(0xFF9D88C0),
surface: Color(0xFF1a1c26),
background: Color(0xFF1a1c26),
),
textTheme: GoogleFonts.varelaRoundTextTheme(
ThemeData.dark().textTheme,
Expand Down
2 changes: 1 addition & 1 deletion example/lib/models/custom_storage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:flagsmith_flutter_core/flagsmith_flutter_core.dart';
import 'package:flagsmith/flagsmith.dart';

/// CustomInMemoryStore storage
class CustomInMemoryStore extends CoreStorage {
Expand Down
Loading

0 comments on commit e0d0b9d

Please sign in to comment.