Skip to content

Commit 21e8703

Browse files
authored
chore: v0.2.0 (#23)
1 parent 6602ed5 commit 21e8703

File tree

3 files changed

+87
-1
lines changed

3 files changed

+87
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.2.0
2+
3+
- ci: use semantic-pull-request workflow ([#8](https://github.com/VeryGoodOpenSource/very_good_test_runner/pull/8))
4+
- ci: add dependabot ([#9](https://github.com/VeryGoodOpenSource/very_good_test_runner/pull/9))
5+
- feat!: update workflows, add spellcheck, update very_good_analysis ([#16](https://github.com/VeryGoodOpenSource/very_good_test_runner/pull/16))
6+
- feat!: Update Dart to 3.0.0 ([#20](https://github.com/VeryGoodOpenSource/very_good_test_runner/pull/20))
7+
18
# [0.1.2](https://github.com/VeryGoodOpenSource/very_good_test_runner/compare/v0.1.1...v0.1.2) (2022-05-05)
29

310
### Features

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: very_good_test_runner
22
description: A test runner for Flutter and Dart created by Very Good Ventures
33
homepage: https://github.com/VeryGoodOpenSource/very_good_test_runner
4-
version: 0.1.2
4+
version: 0.2.0
55

66
environment:
77
sdk: ">=3.0.0 <4.0.0"

tool/release_ready.sh

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
# `./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/npm) package or brick."
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=$(dart pub deps --json | pcregrep -o1 -i '"version": "(.*?)"' | head -1)
24+
25+
if [ -z "$old_version" ]; then
26+
echo "Current version was not resolved."
27+
exit 1
28+
fi
29+
30+
# Get new version
31+
new_version="$1";
32+
33+
if [[ "$new_version" == "" ]]; then
34+
echo "No new version supplied, please provide one"
35+
exit 1
36+
fi
37+
38+
if [[ "$new_version" == "$old_version" ]]; then
39+
echo "Current version is $old_version, can't update."
40+
exit 1
41+
fi
42+
43+
# Retrieving all the commits in the current directory since the last tag.
44+
previousTag="v${old_version}"
45+
raw_commits="$(git log --pretty=format:"%s" --no-merges --reverse $previousTag..HEAD -- .)"
46+
markdown_commits=$(echo "$raw_commits" | sed -En "s/\(#([0-9]+)\)/([#\1](https:\/\/github.com\/VeryGoodOpenSource\/very_good_test_runner\/pull\/\1))/p")
47+
48+
if [[ "$markdown_commits" == "" ]]; then
49+
echo "No commits since last tag, can't update."
50+
exit 0
51+
fi
52+
commits=$(echo "$markdown_commits" | sed -En "s/^/- /p")
53+
54+
echo "Updating version to $new_version"
55+
sed -i '' "s/version: $old_version/version: $new_version/g" pubspec.yaml
56+
57+
# Update dart file with new version.
58+
dart run build_runner build --delete-conflicting-outputs > /dev/null
59+
60+
if grep -q v$new_version "CHANGELOG.md"; then
61+
echo "CHANGELOG already contains version $new_version."
62+
exit 1
63+
fi
64+
65+
# Add a new version entry with the found commits to the CHANGELOG.md.
66+
echo "# ${new_version} \n\n ${commits}\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
67+
echo "CHANGELOG generated, validate entries here: $(pwd)/CHANGELOG.md"
68+
69+
echo "Creating git branch for ver_good_cli@$new_version"
70+
git checkout -b "chore/$new_version" > /dev/null
71+
72+
git add pubspec.yaml CHANGELOG.md
73+
if [ -f lib/src/version.dart ]; then
74+
git add lib/src/version.dart
75+
fi
76+
77+
echo ""
78+
echo "Run the following command if you wish to commit the changes:"
79+
echo "git commit -m \"chore: v$new_version\""

0 commit comments

Comments
 (0)