Skip to content

Commit b344eb6

Browse files
authored
Merge pull request #81 from ant-media/releaseNewVersion
new release
2 parents 732d6bc + 6ffff4c commit b344eb6

File tree

3 files changed

+64
-28
lines changed

3 files changed

+64
-28
lines changed

Diff for: .github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
if: contains(github.event.head_commit.message, 'release')
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v3
16+
with:
17+
distribution: 'zulu'
18+
java-version: '17'
19+
20+
- name: Install Flutter
21+
uses: subosito/flutter-action@v2
22+
with:
23+
channel: 'stable'
24+
25+
- name: Setup Pub Credentials
26+
shell: bash
27+
env:
28+
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
29+
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
30+
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
31+
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
32+
run: |
33+
sh ./pub_login.sh
34+
35+
- name: Check Publish Warnings
36+
run: |
37+
sudo cat /$HOME/.config/dart/pub-credentials.json
38+
flutter pub publish --dry-run
39+
40+
- name: Publish Package
41+
run: |
42+
yes | flutter pub publish

Diff for: .github/workflows/publish.yml renamed to .github/workflows/run_test.yml

+2-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
name: Run Test Cases And Publish Package
2+
name: Run Test Cases
33

44
on: [pull_request]
55

@@ -35,26 +35,5 @@ jobs:
3535
with:
3636
api-level: 29
3737
script: |
38-
cd example/SampleProject && flutter test integration_test/test_conference.dart
3938
cd example/SampleProject && flutter test integration_test/test_play.dart
40-
41-
# Uncomment and adjust for publishing your package
42-
- name: Setup Pub Credentials
43-
shell: bash
44-
env:
45-
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
46-
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
47-
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
48-
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
49-
run: |
50-
sh ./pub_login.sh
51-
52-
- name: Check Publish Warnings
53-
run: |
54-
sudo cat /$HOME/.config/dart/pub-credentials.json
55-
flutter pub publish --dry-run
56-
57-
- name: Publish Package
58-
if: github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, 'release')
59-
run: |
60-
yes | flutter pub publish
39+
cd example/SampleProject && flutter test integration_test/test_conference.dart

Diff for: example/SampleProject/integration_test/test_play.dart

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter_test/flutter_test.dart';
3+
import 'package:flutter_webrtc/flutter_webrtc.dart';
34
import 'package:integration_test/integration_test.dart';
45
import 'test_helper.dart';
56

@@ -24,11 +25,25 @@ void main() {
2425

2526
// Enter Room ID and tap OK.
2627
await enterRoomId(tester, '24x7test');
27-
await tester.pumpAndSettle(const Duration(seconds: 30));
28-
29-
// Verify the content of the SnackBar.
30-
final callEndIcon = find.byIcon(Icons.call_end);
31-
await tester.tap(callEndIcon);
3228
await tester.pumpAndSettle();
29+
30+
const maxWaitTime = Duration(seconds: 120);
31+
final stopwatch = Stopwatch()..start();
32+
33+
while (true) {
34+
if (stopwatch.elapsed > maxWaitTime) {
35+
fail('play did not start');
36+
}
37+
final callEndIcon = find.byIcon(Icons.call_end);
38+
39+
if(tester.any(callEndIcon)) {
40+
await tester.tap(callEndIcon);
41+
await tester.pumpAndSettle();
42+
print("test: play started");
43+
break;
44+
}
45+
await tester.pumpAndSettle(const Duration(seconds: 10));
46+
}
3347
});
3448
}
49+

0 commit comments

Comments
 (0)