Skip to content

Commit 9695cd9

Browse files
committed
0.0.5
1 parent 5632af9 commit 9695cd9

File tree

7 files changed

+39
-31
lines changed

7 files changed

+39
-31
lines changed

.flutter-plugins-dependencies

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/publish-on-pub.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ migrate_working_dir/
2828
.dart_tool/
2929
.packages
3030
build/
31+
.flutter-plugins-dependencies

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## 0.0.4
1+
## 0.0.5
22

33
- Add `value` setter.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: local_file_preferences
22
description: This package provides local json file saving and Loading utility.
3-
version: 0.0.3
3+
version: 0.0.5
44
homepage: https://mj-studio-library.github.io/flutter-local-file-preferences/
55
repository: https://github.com/mj-studio-library/flutter-local-file-preferences
66

tool/publish/check_version.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:io';
2+
23
import 'package:yaml/yaml.dart';
34

45
// ignore_for_file: avoid_print
@@ -12,16 +13,13 @@ void main(List<String> args) {
1213
var tagVersion = '';
1314
if (args.isNotEmpty) {
1415
tagVersion = args[0].split('/').last;
16+
} else {
17+
throw Exception();
1518
}
1619
if (tagVersion.startsWith('v')) {
1720
tagVersion = tagVersion.substring(1);
1821
}
1922

20-
if (pubspecVersion != tagVersion) {
21-
throw Exception(
22-
'pubspec version ($pubspecVersion) and tag version ($tagVersion) are different');
23-
}
24-
2523
String changeLog = File('CHANGELOG.md').readAsStringSync();
2624
if (!changeLog.startsWith('## $tagVersion')) {
2725
throw Exception(

tool/publish/publish.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
fail() {
2+
echo "ERROR: ${1}"
3+
exit 1
4+
}
5+
6+
tag=$1
7+
8+
if [[ -z $tag ]]; then
9+
fail 'arg fail'
10+
fi
11+
12+
flutter pub get
13+
if [[ $? -ne 0 ]]; then
14+
fail 'fail'
15+
fi
16+
flutter pub run tool/publish/check_version.dart $tag
17+
if [[ $? -ne 0 ]]; then
18+
fail 'fail'
19+
fi
20+
flutter analyze
21+
if [[ $? -ne 0 ]]; then
22+
fail 'fail'
23+
fi
24+
dart format --set-exit-if-changed .
25+
if [[ $? -ne 0 ]]; then
26+
fail 'fail'
27+
fi
28+
flutter pub publish --force
29+
if [[ $? -ne 0 ]]; then
30+
fail 'fail'
31+
fi
32+
git tag $tag
33+
git push origin $tag

0 commit comments

Comments
 (0)