diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..1cf6bdd --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,39 @@ +name: ci +on: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + branches: + - 'main' + paths-ignore: + - '**.md' + - 'docs/**' + +permissions: write-all + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + ci: + name: Run tests + if: | + github.repository_owner == 'eaceto' && + github.event.pull_request.draft == false + runs-on: ubuntu-latest + steps: + # Checks out a copy of the repo. + - name: Check out code + uses: actions/checkout@v4 + # Install Flutter stable version + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + # Get dependencies + - run: flutter pub get + # Run tests + - run: flutter test \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 995816d..80ad581 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.0 + +- Add GitHub actions for publishing releases to pub.dev automatically + ## 1.1.0 - Add a localization model for messages shown to the user diff --git a/android/build.gradle b/android/build.gradle index 7de6b17..e7e228a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'dev.eaceto.mobile.oss.flutter.flutter_local_authentication' -version '1.1.0' +version '1.2.0' buildscript { ext.kotlin_version = '1.7.10' diff --git a/ios/flutter_local_authentication.podspec b/ios/flutter_local_authentication.podspec index 2f56852..5a007a2 100644 --- a/ios/flutter_local_authentication.podspec +++ b/ios/flutter_local_authentication.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'flutter_local_authentication' - s.version = '1.1.0' + s.version = '1.2.0' s.summary = 'A flutter plugin that allows access to Local Authentication' s.description = <<-DESC A flutter plugin that allows access to Local Authentication / Biometrics on iOS, macOS, Linux and Android. diff --git a/macos/flutter_local_authentication.podspec b/macos/flutter_local_authentication.podspec index df2f8ca..2759ed0 100644 --- a/macos/flutter_local_authentication.podspec +++ b/macos/flutter_local_authentication.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'flutter_local_authentication' - s.version = '1.1.0' + s.version = '1.2.0' s.summary = 'A flutter plugin that allows access to Local Authentication' s.description = <<-DESC A flutter plugin that allows access to Local Authentication / Biometrics on iOS, macOS, Linux and Android. diff --git a/pubspec.yaml b/pubspec.yaml index 2b23d6e..084ce45 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,12 +1,12 @@ name: flutter_local_authentication description: "A flutter plugin that allows access to Local Authentication / Biometrics on iOS, macOS, Linux and Android." -version: 1.1.0 +version: 1.2.0 homepage: "https://eaceto.dev" repository: "https://github.com/eaceto/flutter_local_authentication/" environment: sdk: '>=3.1.3 <4.0.0' - flutter: '>=3.3.0' + flutter: '>=3.0.0' dependencies: flutter: diff --git a/test/flutter_local_authentication_test.dart b/test/flutter_local_authentication_test.dart index 35e858c..6f015d3 100644 --- a/test/flutter_local_authentication_test.dart +++ b/test/flutter_local_authentication_test.dart @@ -8,20 +8,20 @@ class MockFlutterLocalAuthenticationPlatform with MockPlatformInterfaceMixin implements FlutterLocalAuthenticationPlatform { final _canAuthenticate = true; - double touchIDAuthenticationAllowableReuseDuration = 0.0; + double _touchIDAuthenticationAllowableReuseDuration = 0.0; @override Future authenticate() => Future.value(_canAuthenticate); @override Future getTouchIDAuthenticationAllowableReuseDuration() => - Future.value(touchIDAuthenticationAllowableReuseDuration); + Future.value(_touchIDAuthenticationAllowableReuseDuration); @override Future setTouchIDAuthenticationAllowableReuseDuration( double duration) { - touchIDAuthenticationAllowableReuseDuration = duration; - return Future.value(touchIDAuthenticationAllowableReuseDuration); + _touchIDAuthenticationAllowableReuseDuration = duration; + return Future.value(_touchIDAuthenticationAllowableReuseDuration); } @override @@ -68,15 +68,14 @@ void main() { MockFlutterLocalAuthenticationPlatform(); FlutterLocalAuthenticationPlatform.instance = fakePlatform; - expect( - await flutterLocalAuthenticationPlugin - .setTouchIDAuthenticationAllowableReuseDuration(30.0), - 30.0); - await flutterLocalAuthenticationPlugin - .setTouchIDAuthenticationAllowableReuseDuration(60.0); - expect( - await flutterLocalAuthenticationPlugin - .getTouchIDAuthenticationAllowableReuseDuration(), - 60.0); + double stored = await flutterLocalAuthenticationPlugin + .setTouchIDAuthenticationAllowableReuseDuration(30.0); + + expect(stored, 30.0); + + stored = await flutterLocalAuthenticationPlugin + .setTouchIDAuthenticationAllowableReuseDuration(45.0); + + expect(stored, 45.0); }); }