Welcome to mirror list, hosted at ThFree Co, Russian Federation.

release-theme.sh « utils - github.com/mattstratton/castanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 27e9b7c450d6c00ff3fee0bad64f6bc169b5d0ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash

current_version=`grep theme_version theme.toml | cut -d '=' -f2 | xargs`
major_version=`echo $current_version | cut -d '.' -f1 | xargs`
minor_version=`echo $current_version | cut -d '.' -f2 | xargs`
patch_version=`echo $current_version | cut -d '.' -f3 | xargs`
echo "Current theme version is $current_version."
read -p "Do you want a [1] major, [2] minor, or [3] patch version? " version_level
echo "Major version is $major_version."
echo "Minor version is $minor_version."
echo "Patch version is $patch_version."

case $version_level in
  '1')
  let "major_version += 1"
  echo "Major version is now $major_version"
  new_version=$major_version
  new_version+=".0.0"
  echo "new version is now $new_version"
  ;;
  '2')
  let "minor_version += 1"
  echo "Minor version is now $minor_version"
  new_version=$major_version
  new_version+="."
  new_version+=$minor_version
  new_version+=".0"
  echo "new version is now $new_version"
  ;;
  '3')
  let "patch_version += 1"
  new_version=$major_version
  new_version+="."
  new_version+="$minor_version"
  new_version+="."
  new_version+=$patch_version
  echo "Patch version is now $patch_version"
  echo "new version is now $new_version"
  ;;
  *)
  echo "Invalid option"
  ;;
esac

git stash
git checkout master
git pull origin master
github_changelog_generator --user mattstratton --project castanet --future-release "$new_version" --no-issues-wo-labels --no-pr-wo-labels --no-compare-link --exclude-labels='duplicate,question,invalid,wontfix,do-not-merge,no-changelog'
sed -i '' "s/$current_version/$new_version/g" ./theme.toml

git add .
git commit -m "Update theme to version $new_version"
git tag -a $new_version -m "$new_version"