Files
modeling-app/make-release.sh

78 lines
2.0 KiB
Bash
Raw Normal View History

#!/bin/bash
if ! git diff-index --quiet HEAD --; then
echo "Please stash uncommitted changes before running release script"
exit 1
fi
git checkout main
git pull
git fetch --all
# Get the latest semver tag from git
latest_tag=$(jq -r '.version' package.json)
latest_tag="v$latest_tag"
# Print the latest semver tag
echo "Latest semver tag: $latest_tag"
# Function to bump version numbers
bump_version() {
local version=$1
local bump_type=$2
local major=$(echo $version | cut -d '.' -f 1 | sed 's/v//')
local minor=$(echo $version | cut -d '.' -f 2)
local patch=$(echo $version | cut -d '.' -f 3)
case "$bump_type" in
major)
major=$((major + 1))
minor=0
patch=0
;;
minor)
minor=$((minor + 1))
patch=0
;;
*)
patch=$((patch + 1))
;;
esac
echo "v${major}.${minor}.${patch}"
}
# Determine the type of bump based on the argument
bump_type=${1:-patch}
# Bump the version
new_version=$(bump_version $latest_tag $bump_type)
# Print the new semver tag
echo "New semver tag: $new_version"
new_version_number=${new_version:1}
echo "New version number without 'v': $new_version_number"
git checkout -b "cut-release-$new_version"
echo "$(jq --arg v "$new_version_number" '.version=$v' package.json --indent 2)" > package.json
First steps for electron app build and packaging in Github Actions Builds on the ci.yml refactor started at !2815 commit 6813adf86d1d7b78a9a4e77039313dccd67c3083 Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 11:27:03 2024 -0400 Lint commit fe95e2e1302beb213da9f9bde5feeda255e116fd Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 10:34:34 2024 -0400 Disable sign if not BUILD_RELEASE commit 8f31952e217f1dc1c683705cdb28bdd7042ccdc7 Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 08:31:42 2024 -0400 WIP sign windows commit fbabc874d41e8e57011454afec68c2b4926c842b Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 07:51:20 2024 -0400 WIP macos commit 6a8cc629e45b0c041fb31f1daf5f3a56f10871cc Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 11:15:28 2024 +0000 Change executable name for deb commit b616aece2673086c2bf376d583dd4f0d8c09a23d Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 05:56:26 2024 -0400 WIP macos signing, ubuntu build commit b4c7ac8b9b73d18f26d2d1e7cfe0494e713e5231 Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 05:41:53 2024 -0400 Fix ubuntu target commit 23b694327e2c5ee570257fb66f51ff65b7b6f6f4 Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 05:23:29 2024 -0400 Fix upload for Windows, add ubuntu commit 54df186f632a277e68b280fccd547f83208c2b8b Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Mon Aug 5 05:00:47 2024 -0400 Fix tsc, remove e2e/tauri tests commit 1c76e793d1b2d8781f5fce7399b3118438331428 Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Sat Aug 3 08:25:39 2024 -0400 Lint, codespell, remove tauri/wdio ref, add author commit 51e91558978e634677e58c8c7248b0bbda0a82d6 Author: Pierre Jacquier <pierrejacquier39@gmail.com> Date: Sat Aug 3 08:11:24 2024 -0400 Add new ci.yml breakdown from pierremtb/issue2805. Windows and macOS only for now
2024-08-05 11:58:53 -04:00
git add package.json
git commit -m "Cut release $new_version"
echo ""
echo "Versions has been bumped in relevant json files, a branch has been created and committed to."
echo ""
echo "What's left for you to do is, push the branch and make the release PR."
echo ""
echo "Suggested changelog:"
echo "\`\`\`"
echo "## What's Changed"
git log $(git describe --tags --abbrev=0)..HEAD --oneline --pretty=format:%s | grep -v Bump | grep -v 'Cut release v' | awk '{print "* "toupper(substr($0,0,1))substr($0,2)}'
echo ""
echo "**Full Changelog**: https://github.com/KittyCAD/modeling-app/compare/${latest_tag}...${new_version}"
echo "\`\`\`"
echo "and would recommend removing ones that aren't related to the product (eg. CI changes)"