From e964488627f63a9db9fbbc7cd0cfe1f97f81f61e Mon Sep 17 00:00:00 2001 From: USAMAWIZARD Date: Sat, 8 Mar 2025 00:05:53 +0530 Subject: [PATCH 1/8] new release --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7c1fa45..1d525f8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,8 +35,8 @@ jobs: with: api-level: 29 script: | - cd example/SampleProject && flutter test integration_test/test_conference.dart cd example/SampleProject && flutter test integration_test/test_play.dart + cd example/SampleProject && flutter test integration_test/test_conference.dart # Uncomment and adjust for publishing your package - name: Setup Pub Credentials From 5a020ef726236ce8b5ec611cfd2cec8e545caa04 Mon Sep 17 00:00:00 2001 From: USAMA Date: Fri, 7 Mar 2025 23:15:34 +0530 Subject: [PATCH 2/8] Update test_play.dart --- example/SampleProject/integration_test/test_play.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/SampleProject/integration_test/test_play.dart b/example/SampleProject/integration_test/test_play.dart index dfe02c0..cef963b 100644 --- a/example/SampleProject/integration_test/test_play.dart +++ b/example/SampleProject/integration_test/test_play.dart @@ -23,7 +23,7 @@ void main() { await tester.pumpAndSettle(); // Enter Room ID and tap OK. - await enterRoomId(tester, '24x7test'); + await enterRoomId(tester, 'live_test'); await tester.pumpAndSettle(const Duration(seconds: 30)); // Verify the content of the SnackBar. From 743f4a0c17a60d41b7a7714f12a19f94b965ed2b Mon Sep 17 00:00:00 2001 From: USAMA Date: Sat, 8 Mar 2025 00:58:09 +0530 Subject: [PATCH 3/8] release new version --- .../integration_test/test_play.dart | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/example/SampleProject/integration_test/test_play.dart b/example/SampleProject/integration_test/test_play.dart index cef963b..0a072d9 100644 --- a/example/SampleProject/integration_test/test_play.dart +++ b/example/SampleProject/integration_test/test_play.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter_webrtc/flutter_webrtc.dart'; import 'package:integration_test/integration_test.dart'; import 'test_helper.dart'; @@ -23,12 +24,24 @@ void main() { await tester.pumpAndSettle(); // Enter Room ID and tap OK. - await enterRoomId(tester, 'live_test'); - await tester.pumpAndSettle(const Duration(seconds: 30)); - - // Verify the content of the SnackBar. - final callEndIcon = find.byIcon(Icons.call_end); - await tester.tap(callEndIcon); + await enterRoomId(tester, '24x7test'); await tester.pumpAndSettle(); + expect(find.byType(RTCVideoView), findsOneWidget); + + final rtcVideoViewFinder = find.byType(RTCVideoView); + expect(rtcVideoViewFinder, findsOneWidget); + + final rtcVideoView = tester.widget(rtcVideoViewFinder); + RTCVideoRenderer renderer = rtcVideoView.videoRenderer; + + const maxWaitTime = Duration(seconds: 67); + final stopwatch = Stopwatch()..start(); + + while (renderer.videoWidth == 0 || renderer.videoHeight == 0) { + if (stopwatch.elapsed > maxWaitTime) { + fail('RTCVideoRenderer did not start playing within 45 seconds'); + } + await tester.pumpAndSettle(const Duration(seconds: 1)); + } }); } From 4dc9e2e9a3c62d1b11eecdef093804b64a7657b7 Mon Sep 17 00:00:00 2001 From: USAMA Date: Sat, 8 Mar 2025 01:16:15 +0530 Subject: [PATCH 4/8] Update test_play.dart --- example/SampleProject/integration_test/test_play.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/SampleProject/integration_test/test_play.dart b/example/SampleProject/integration_test/test_play.dart index 0a072d9..3046aba 100644 --- a/example/SampleProject/integration_test/test_play.dart +++ b/example/SampleProject/integration_test/test_play.dart @@ -34,12 +34,12 @@ void main() { final rtcVideoView = tester.widget(rtcVideoViewFinder); RTCVideoRenderer renderer = rtcVideoView.videoRenderer; - const maxWaitTime = Duration(seconds: 67); + const maxWaitTime = Duration(seconds: 120); final stopwatch = Stopwatch()..start(); while (renderer.videoWidth == 0 || renderer.videoHeight == 0) { if (stopwatch.elapsed > maxWaitTime) { - fail('RTCVideoRenderer did not start playing within 45 seconds'); + fail('RTCVideoRenderer did not start playing within 120 seconds'); } await tester.pumpAndSettle(const Duration(seconds: 1)); } From e74a8929b3e5c00cd2f444b8eed70a0f2bc78dc4 Mon Sep 17 00:00:00 2001 From: USAMA Date: Sat, 8 Mar 2025 01:32:04 +0530 Subject: [PATCH 5/8] Update test_play.dart --- example/SampleProject/integration_test/test_play.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/SampleProject/integration_test/test_play.dart b/example/SampleProject/integration_test/test_play.dart index 3046aba..9fabc67 100644 --- a/example/SampleProject/integration_test/test_play.dart +++ b/example/SampleProject/integration_test/test_play.dart @@ -34,14 +34,14 @@ void main() { final rtcVideoView = tester.widget(rtcVideoViewFinder); RTCVideoRenderer renderer = rtcVideoView.videoRenderer; - const maxWaitTime = Duration(seconds: 120); + const maxWaitTime = Duration(seconds: 200); final stopwatch = Stopwatch()..start(); while (renderer.videoWidth == 0 || renderer.videoHeight == 0) { if (stopwatch.elapsed > maxWaitTime) { - fail('RTCVideoRenderer did not start playing within 120 seconds'); + fail('RTCVideoRenderer did not start playing within 200 seconds'); } - await tester.pumpAndSettle(const Duration(seconds: 1)); + await tester.pumpAndSettle(const Duration(seconds: 10)); } }); } From 49d3f50b6ca98528d07d88942faf9fcfc7fc1640 Mon Sep 17 00:00:00 2001 From: USAMA Date: Sat, 8 Mar 2025 13:44:08 +0530 Subject: [PATCH 6/8] new release --- .../integration_test/test_play.dart | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/example/SampleProject/integration_test/test_play.dart b/example/SampleProject/integration_test/test_play.dart index 9fabc67..4519f69 100644 --- a/example/SampleProject/integration_test/test_play.dart +++ b/example/SampleProject/integration_test/test_play.dart @@ -26,22 +26,24 @@ void main() { // Enter Room ID and tap OK. await enterRoomId(tester, '24x7test'); await tester.pumpAndSettle(); - expect(find.byType(RTCVideoView), findsOneWidget); - final rtcVideoViewFinder = find.byType(RTCVideoView); - expect(rtcVideoViewFinder, findsOneWidget); - - final rtcVideoView = tester.widget(rtcVideoViewFinder); - RTCVideoRenderer renderer = rtcVideoView.videoRenderer; - - const maxWaitTime = Duration(seconds: 200); + const maxWaitTime = Duration(seconds: 120); final stopwatch = Stopwatch()..start(); - while (renderer.videoWidth == 0 || renderer.videoHeight == 0) { + while (true) { if (stopwatch.elapsed > maxWaitTime) { - fail('RTCVideoRenderer did not start playing within 200 seconds'); + fail('play did not start'); + } + final callEndIcon = find.byIcon(Icons.call_end); + + if(tester.any(callEndIcon)) { + await tester.tap(callEndIcon); + await tester.pumpAndSettle(); + print("test: play started"); + break; } await tester.pumpAndSettle(const Duration(seconds: 10)); } }); } + From aa410a7e157903803c9192750a33923bd5882776 Mon Sep 17 00:00:00 2001 From: USAMA Date: Sat, 8 Mar 2025 13:56:35 +0530 Subject: [PATCH 7/8] new release --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1d525f8..9e1e7ac 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -55,6 +55,6 @@ jobs: flutter pub publish --dry-run - name: Publish Package - if: github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, 'release') + if: contains(github.event.head_commit.message, 'release') run: | yes | flutter pub publish From 6ffff4c43f15e308f1951376fde5d7651a02af28 Mon Sep 17 00:00:00 2001 From: USAMA Date: Mon, 10 Mar 2025 12:27:32 +0530 Subject: [PATCH 8/8] diffrent ci for test and release --- .github/workflows/release.yml | 42 +++++++++++++++++++ .../workflows/{publish.yml => run_test.yml} | 23 +--------- 2 files changed, 43 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/release.yml rename .github/workflows/{publish.yml => run_test.yml} (54%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..646a3b0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Publish Package + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + if: contains(github.event.head_commit.message, 'release') + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '17' + + - name: Install Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + + - name: Setup Pub Credentials + shell: bash + env: + PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }} + PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }} + PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }} + PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }} + run: | + sh ./pub_login.sh + + - name: Check Publish Warnings + run: | + sudo cat /$HOME/.config/dart/pub-credentials.json + flutter pub publish --dry-run + + - name: Publish Package + run: | + yes | flutter pub publish \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/run_test.yml similarity index 54% rename from .github/workflows/publish.yml rename to .github/workflows/run_test.yml index 9e1e7ac..0d859f9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/run_test.yml @@ -1,5 +1,5 @@ -name: Run Test Cases And Publish Package +name: Run Test Cases on: [pull_request] @@ -37,24 +37,3 @@ jobs: script: | cd example/SampleProject && flutter test integration_test/test_play.dart cd example/SampleProject && flutter test integration_test/test_conference.dart - - # Uncomment and adjust for publishing your package - - name: Setup Pub Credentials - shell: bash - env: - PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }} - PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }} - PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }} - PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }} - run: | - sh ./pub_login.sh - - - name: Check Publish Warnings - run: | - sudo cat /$HOME/.config/dart/pub-credentials.json - flutter pub publish --dry-run - - - name: Publish Package - if: contains(github.event.head_commit.message, 'release') - run: | - yes | flutter pub publish