Skip to content

Commit 7ce5cef

Browse files
committed
Improve release process
1 parent bd730f2 commit 7ce5cef

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

RELEASE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Release checklist
22

33
- run `pana --no-warning` and check score is 130/130
4-
- Bump version in `pubspec.yaml`
5-
- Increment `wiredashSdkVersion` in `lib/src/version.dart` by `1` for patch releases, by `10` for minor releases
4+
- Bump version with `wiresdk bump-version --minor` (or `--major`, `--patch`) which does
5+
- Bump version in `pubspec.yaml`
6+
- Increment `wiredashSdkVersion` in `lib/src/version.dart` by `1` for patch releases, by `10` for minor releases
7+
- Update version in `README.md`
68
- Set `kDevMode` in `lib/src/_wiredash_internal.dart` to `false`
79
- Write release notes in `CHANGELOG.md` (Check https://github.com/wiredashio/wiredash-sdk/compare/v1.0.0...stable to compare what changed)
810
- Commit changes

wiresdk_sidekick/lib/wiresdk_sidekick.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,24 @@ Future<void> bumpReadme(
8080
) async {
8181
final readme = package.root.file('README.md');
8282
final content = readme.readAsStringSync();
83-
final minorRelease = '${newVersion.major}.${newVersion.minor}.0';
84-
if (Version.parse(minorRelease) <= newVersion) {
83+
final oldMinorRelease =
84+
Version.parse('${oldVersion.major}.${oldVersion.minor}.0');
85+
final newMinorRelease =
86+
Version.parse('${newVersion.major}.${newVersion.minor}.0');
87+
if (oldMinorRelease == newMinorRelease) {
8588
print("Not updating version in README.md, "
86-
"because it's not a major or minor version bump");
89+
"because it's not a major or minor version bump (old: $oldVersion, new: $newVersion)");
8790
return;
8891
}
8992

93+
print(
94+
'Bumping version in README.md to ${newMinorRelease.canonicalizedVersion}');
9095
final versionRegex = RegExp(r'wiredash:\s*\^(.+)');
9196
final update = content.replaceAllMapped(
9297
versionRegex,
9398
(match) {
94-
return match[0]!.replaceFirst(match[1]!, minorRelease);
99+
return match[0]!
100+
.replaceFirst(match[1]!, newMinorRelease.canonicalizedVersion);
95101
},
96102
);
97103
readme.writeAsStringSync(update);

wiresdk_sidekick/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ executables:
1111

1212
dependencies:
1313
dcli: ^2.2.3
14-
phntmxyz_bump_version_sidekick_plugin: ^1.2.0
14+
phntmxyz_bump_version_sidekick_plugin: ^1.2.1
1515
sidekick_core: ^2.1.0
1616

1717
dev_dependencies:

0 commit comments

Comments
 (0)