Skip to content

Commit dda28cc

Browse files
authored
chore(brick): v0.1.0-dev.8 (#65)
1 parent 66e645b commit dda28cc

File tree

3 files changed

+88
-1
lines changed

3 files changed

+88
-1
lines changed

bricks/r13n/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 0.1.0-dev.8
2+
3+
- refactor: decompose hooks into multiple files ([#43](https://github.com/VeryGoodOpenSource/r13n/pull/43))
4+
- chore: update dart, analysis and fix lint ([#57](https://github.com/VeryGoodOpenSource/r13n/pull/57))
5+
6+
# 0.1.0-dev.7
7+
8+
- fix: only format arb directory in post_gen hook
9+
110
# 0.1.0-dev.7
211

312
- fix: only format arb directory in post_gen hook

bricks/r13n/brick.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: r13n
22
description: A brick that generates regionalization (r13n) code from arb files. Built by Very Good Ventures.
33
repository: https://github.com/VeryGoodOpenSource/r13n
44

5-
version: 0.1.0-dev.7
5+
version: 0.1.0-dev.8
66

77
environment:
88
mason: ">=0.1.0-dev.28 <0.1.0"

bricks/r13n/tool/release_ready.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
3+
# Ensures that the brick is ready for a release.
4+
#
5+
# Will update the brick.yaml 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 "brick.yaml" ]; then
12+
echo "$(pwd) is not a valid 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=""
24+
if [ -f "brick.yaml" ]; then
25+
old_version=$(cat brick.yaml | pcregrep 'version: (.*?)' | tr " " "\n" | tail -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="r13n_brick-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\/r13n\/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 "brick.yaml" ]; then
59+
sed -i '' "s/version: $old_version/version: $new_version/g" brick.yaml
60+
fi
61+
62+
if grep -q v$new_version "CHANGELOG.md"; then
63+
echo "CHANGELOG already contains version $new_version."
64+
exit 1
65+
fi
66+
67+
# Add a new version entry with the found commits to the CHANGELOG.md.
68+
echo "# ${new_version} \n\n${commits}\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
69+
echo "CHANGELOG generated, validate entries here: $(pwd)/CHANGELOG.md"
70+
71+
echo "Creating git branch for ver_good_cli@$new_version"
72+
git checkout -b "chore/r13n_brick-v$new_version" > /dev/null
73+
74+
git add brick.yaml CHANGELOG.md
75+
76+
echo ""
77+
echo "Run the following command if you wish to commit the changes:"
78+
echo "git commit -m \"chore(brick): v$new_version\""

0 commit comments

Comments
 (0)