Skip to content

Commit 5fa0cf6

Browse files
authored
version check before pub upload for CI. (#372)
* version check before pub upload for CI. * update. * update. * Update publish.yaml * Update publish.yaml * Update publish.yaml * Update build.yaml * Correct the version, CI should pass. * release: 1.5.2.
1 parent 8f16ced commit 5fa0cf6

File tree

8 files changed

+50
-6
lines changed

8 files changed

+50
-6
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
run: dart format lib/ test/ --set-exit-if-changed
4141
- name: Import Sorter Check
4242
run: dart run import_sorter:main --no-comments --exit-if-changed
43+
- name: Check version consistency
44+
run: dart run scripts/check_version.dart
4345
- name: Dart Analyze Check
4446
run: flutter analyze
4547
- name: Dart Test Check

.github/workflows/publish.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install Flutter
2727
uses: subosito/flutter-action@v2
2828
with:
29-
flutter-version: '3.10.0'
29+
channel: 'stable'
3030
- name: Install project dependencies
3131
run: flutter pub get
3232
- name: Dart Format Check
@@ -37,9 +37,17 @@ jobs:
3737
run: flutter analyze
3838
- name: Dart Test Check
3939
run: flutter test
40+
- name: Check version consistency
41+
run: dart run scripts/check_version.dart
4042
#- name: Check Publish Warnings
4143
# run: dart pub publish --dry-run
42-
44+
- name: Publish
45+
uses: k-paxian/[email protected]
46+
with:
47+
credentialJson: ${{ secrets.CREDENTIAL_JSON }}
48+
flutter: true
49+
skipTests: true
50+
force: true
4351
- run: flutter pub global activate dartdoc
4452

4553
# Generate docs

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## 1.5.2
4+
5+
* Non-functional update, forcing the versions in
6+
`'ios/livekit_client.podspec', 'macos/livekit_client.podspec', 'lib/src/livekit.dart'`
7+
consistent with pubspec.yaml
8+
39
## 1.5.1
410

511
* Fixed Renderer bug for Windows.

ios/livekit_client.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'livekit_client'
3-
s.version = '1.5.1'
3+
s.version = '1.5.2'
44
s.summary = 'Open source platform for real-time audio and video.'
55
s.description = 'Open source platform for real-time audio and video.'
66
s.homepage = 'https://livekit.io/'

lib/src/livekit.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import 'types/other.dart';
1919
/// Main entry point to connect to a room.
2020
/// {@category Room}
2121
class LiveKitClient {
22-
static const version = '1.4.2';
22+
static const version = '1.5.2';
2323

2424
/// Convenience method for connecting to a LiveKit server.
2525
/// Returns a [Room] upon a successful connect or throws when it fails.

macos/livekit_client.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'livekit_client'
3-
s.version = '1.5.1'
3+
s.version = '1.5.2'
44
s.summary = 'Open source platform for real-time audio and video.'
55
s.description = 'Open source platform for real-time audio and video.'
66
s.homepage = 'https://livekit.io/'

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
name: livekit_client
1616
description: Flutter Client SDK for LiveKit.
1717
Build real-time video and audio into your apps. Supports iOS, Android, and Web.
18-
version: 1.5.1
18+
version: 1.5.2
1919
homepage: https://livekit.io
2020

2121
environment:
@@ -52,6 +52,7 @@ dev_dependencies:
5252
flutter_lints: ^2.0.1
5353
mockito: ^5.3.2
5454
import_sorter: ^4.6.0
55+
yaml: ^3.1.2
5556

5657
import_sorter:
5758
comments: false

scripts/check_version.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import 'dart:io';
2+
3+
import 'package:yaml/yaml.dart';
4+
5+
void main() {
6+
File pubspec = File('pubspec.yaml');
7+
var doc = loadYaml(pubspec.readAsStringSync());
8+
var version = doc['version'];
9+
10+
var files = [
11+
'ios/livekit_client.podspec',
12+
'macos/livekit_client.podspec',
13+
'lib/src/livekit.dart'
14+
];
15+
16+
for (var file in files) {
17+
var content = File(file).readAsStringSync();
18+
if (!content.contains(version)) {
19+
RegExp exp = RegExp(r'(\d+\.\d+\.\d+)');
20+
RegExpMatch? match = exp.firstMatch(content);
21+
// ignore: avoid_print
22+
print(
23+
'Version mismatch in $file, pubspec.yaml version is $version != ${match![0]} in $file, please update');
24+
exit(1);
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)