diff --git a/brick/CHANGELOG.md b/brick/CHANGELOG.md index 5b9cabc..ed6a4ae 100644 --- a/brick/CHANGELOG.md +++ b/brick/CHANGELOG.md @@ -1,3 +1,14 @@ +# 0.0.2 + +- build(deps-dev): bump @tsconfig/docusaurus in /src/very_good_docs_site ([#135](https://github.com/VeryGoodOpenSource/very_good_docs_site/pull/135)) +- chore: generate template ([#136](https://github.com/VeryGoodOpenSource/very_good_docs_site/pull/136)) +- build(deps): bump @docusaurus/core in /src/very_good_docs_site ([#140](https://github.com/VeryGoodOpenSource/very_good_docs_site/pull/140)) +- build(deps): bump @docusaurus/preset-classic in /src/very_good_docs_site ([#137](https://github.com/VeryGoodOpenSource/very_good_docs_site/pull/137)) +- build(deps): bump actions/setup-node from 3 to 4 ([#145](https://github.com/VeryGoodOpenSource/very_good_docs_site/pull/145)) +- chore: request code ownership ([#147](https://github.com/VeryGoodOpenSource/very_good_docs_site/pull/147)) +- feat: update to docusaurs 3.0 ([#152](https://github.com/VeryGoodOpenSource/very_good_docs_site/pull/152)) +- refactor: remove generator script ([#162](https://github.com/VeryGoodOpenSource/very_good_docs_site/pull/162)) + # 0.0.1+7 - build(deps): various dependency updates diff --git a/brick/brick.yaml b/brick/brick.yaml index abcd9b8..ca1e0ef 100644 --- a/brick/brick.yaml +++ b/brick/brick.yaml @@ -1,7 +1,7 @@ name: very_good_docs_site description: A Very Good documentation site created by Very Good Ventures. repository: https://github.com/VeryGoodOpenSource/very_good_docs_site -version: 0.0.1+7 +version: 0.0.2 environment: mason: ">=0.1.0-dev.50 <0.1.0" diff --git a/tool/release_ready.sh b/tool/release_ready.sh new file mode 100644 index 0000000..99c9f8b --- /dev/null +++ b/tool/release_ready.sh @@ -0,0 +1,76 @@ +# Ensures that the package or brick is ready for a release. +# +# Set it up for a new version: +# `./release_ready.sh + +# Check if current directory is usable for this script, if so we assume it is correctly set up. +if [ ! -f "brick/brick.yaml" ]; then + echo "$(pwd) is not a valid brick." + exit 1 +fi + +currentBranch=$(git symbolic-ref --short -q HEAD) +if [[ ! $currentBranch == "main" ]]; then + echo "Releasing is only supported on the main branch." + exit 1 +fi + +# Get information +old_version="" +current_name="" +if [ -f "brick/brick.yaml" ]; then + old_version=$(cat brick/brick.yaml | pcregrep 'version: (.*?)' | tr " " "\n" | tail -1) + current_name=$(cat brick/brick.yaml | pcregrep 'name: (.*?)' | tr " " "\n" | tail -1) +fi + +if [ -z "$old_version" ] || [ -z "$current_name" ]; then + echo "Current version or name was not resolved." + exit 1 +fi + +# Get new version +new_version="$1"; + +if [[ "$new_version" == "" ]]; then + echo "No new version supplied, please provide one" + exit 1 +fi + +if [[ "$new_version" == "$old_version" ]]; then + echo "Current version is $old_version, can't update." + exit 1 +fi + +# Retrieving all the commits in the current directory since the last tag. +previousTag="v${old_version}" +raw_commits="$(git log --pretty=format:"%s" --no-merges --reverse $previousTag..HEAD -- .)" +markdown_commits=$(echo "$raw_commits" | sed -En "s/\(#([0-9]+)\)/([#\1](https:\/\/github.com\/VeryGoodOpenSource\/very_good_docs_site\/pull\/\1))/p") + +if [[ "$markdown_commits" == "" ]]; then + echo "No commits since last tag, can't update." + exit 0 +fi +commits=$(echo "$markdown_commits" | sed -En "s/^/- /p") + +echo "Updating version to $new_version" +if [ -f "brick/brick.yaml" ]; then + sed -i '' "s/version: $old_version/version: $new_version/g" brick/brick.yaml +fi + +if grep -q $new_version "brick/CHANGELOG.md"; then + echo "CHANGELOG already contains version $new_version." + exit 1 +fi + +# Add a new version entry with the found commits to the brick/CHANGELOG.md. +echo "# ${new_version}\n\n${commits}\n\n$(cat brick/CHANGELOG.md)" > brick/CHANGELOG.md +echo "CHANGELOG for $current_name generated, validate entries here: $(pwd)/brick/CHANGELOG.md" + +echo "Creating git branch for $current_name@$new_version" +git checkout -b "chore/v$new_version" > /dev/null + +git add brick/brick.yaml brick/CHANGELOG.md + +echo "" +echo "Run the following command if you wish to commit the changes:" +echo "git commit -m \"chore: v$new_version\"" \ No newline at end of file