Skip to content

Commit 827a911

Browse files
authored
chore: v0.5.0 (#66)
1 parent 8623c5c commit 827a911

File tree

3 files changed

+95
-1
lines changed

3 files changed

+95
-1
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 0.5.0
2+
3+
**Note**: This release supports [Flutter 3.16.0](https://docs.flutter.dev/release/release-notes/release-notes-3.16.0), for migration details see the [release notes](https://github.com/VeryGoodOpenSource/mockingjay/releases/tag/v0.5.0).
4+
5+
- chore(deps): bump very_good_analysis from 4.0.0+1 to 5.1.0 ([#56](https://github.com/VeryGoodOpenSource/mockingjay/pull/56))
6+
- chore: update Very Good Analysis to 5.1.0 ([#57](https://github.com/VeryGoodOpenSource/mockingjay/pull/57))
7+
- chore: updated sdk constraints for example ([#60](https://github.com/VeryGoodOpenSource/mockingjay/pull/60))
8+
- docs: update installation instructions readme ([#61](https://github.com/VeryGoodOpenSource/mockingjay/pull/61))
9+
- fix!: Updates for Flutter 3.16.0/Dart 3.2 ([#65](https://github.com/VeryGoodOpenSource/mockingjay/pull/65))
10+
111
# 0.4.0
212

313
- feat: support for `mocktail ^1.0.0`

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: mockingjay
22
description: A package that makes it easy to mock, test and verify navigation calls in Flutter.
3-
version: 0.4.0
3+
version: 0.5.0
44
homepage: https://github.com/VeryGoodOpenSource/mockingjay
55

66
environment:

tool/release_ready.sh

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/bin/bash
2+
3+
# Ensures that the package is ready for a release.
4+
#
5+
# Will update the version.dart file and update the CHANGELOG.md.
6+
#
7+
# Set it up for a new version:
8+
# `sh tool/release_ready.sh <version>`
9+
10+
# Check if current directory is usable for this script, if so we assume it is correctly set up.
11+
if [ ! -f "pubspec.yaml" ]; then
12+
echo "$(pwd) is not a valid Dart package."
13+
exit 1
14+
fi
15+
16+
currentBranch=$(git symbolic-ref --short -q HEAD)
17+
if [[ ! $currentBranch == "main" ]]; then
18+
echo "Releasing is only supported on the main branch."
19+
exit 1
20+
fi
21+
22+
# Get information
23+
old_version=""
24+
if [ -f "pubspec.yaml" ]; then
25+
old_version=$(dart pub deps --json | pcregrep -o1 -i '"version": "(.*?)"' | head -1)
26+
fi
27+
28+
if [ -z "$old_version" ]; then
29+
echo "Current version was not resolved."
30+
exit 1
31+
fi
32+
33+
# Get new version
34+
new_version="$1";
35+
36+
if [[ "$new_version" == "" ]]; then
37+
echo "No new version supplied, please provide one"
38+
exit 1
39+
fi
40+
41+
if [[ "$new_version" == "$old_version" ]]; then
42+
echo "Current version is $old_version, can't update."
43+
exit 1
44+
fi
45+
46+
# Retrieving all the commits in the current directory since the last tag.
47+
previousTag="v${old_version}"
48+
raw_commits="$(git log --pretty=format:"%s" --no-merges --reverse $previousTag..HEAD -- .)"
49+
markdown_commits=$(echo "$raw_commits" | sed -En "s/\(#([0-9]+)\)/([#\1](https:\/\/github.com\/VeryGoodOpenSource\/mockingjay\/pull\/\1))/p")
50+
51+
if [[ "$markdown_commits" == "" ]]; then
52+
echo "No commits since last tag, can't update."
53+
exit 0
54+
fi
55+
commits=$(echo "$markdown_commits" | sed -En "s/^/- /p")
56+
57+
echo "Updating version to $new_version"
58+
if [ -f "pubspec.yaml" ]; then
59+
sed -i '' "s/version: $old_version/version: $new_version/g" pubspec.yaml
60+
fi
61+
62+
# Update dart file with new version.
63+
dart run build_runner build --delete-conflicting-outputs > /dev/null
64+
65+
if grep -q v$new_version "CHANGELOG.md"; then
66+
echo "CHANGELOG already contains version $new_version."
67+
exit 1
68+
fi
69+
70+
# Add a new version entry with the found commits to the CHANGELOG.md.
71+
echo "# ${new_version} \n\n ${commits}\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
72+
echo "CHANGELOG generated, validate entries here: $(pwd)/CHANGELOG.md"
73+
74+
echo "Creating git branch for mockingay@$new_version"
75+
git checkout -b "chore/$new_version" > /dev/null
76+
77+
git add pubspec.yaml CHANGELOG.md
78+
if [ -f lib/src/version.dart ]; then
79+
git add lib/src/version.dart
80+
fi
81+
82+
echo ""
83+
echo "Run the following command if you wish to commit the changes:"
84+
echo "git commit -m \"chore: v$new_version\""

0 commit comments

Comments
 (0)