forked from wix/AppleSimulatorUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreleaseVersion.sh
executable file
·67 lines (47 loc) · 1.69 KB
/
releaseVersion.sh
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo >&2 "Illegal number of parameters"
echo >&2 "releaseVersion.sh <version>"
exit -1
fi
if [[ -n $(git status --porcelain) ]]; then
echo >&2 "Cannot release version because there are unstaged changes:"
git status --short
exit -2
fi
if [[ -n $(git tag --contains $(git rev-parse --verify HEAD)) ]]; then
echo >&2 "The latest commit is already contained in the following releases:"
git tag --contains $(git rev-parse --verify HEAD)
exit -3
fi
if [[ -n $(git log --branches --not --remotes) ]]; then
echo "Pushing commits to git"
git push
fi
echo "Creating commit for version"
echo "\"$1\"" > applesimutils/applesimutils/version.h
echo "Cleaning up"
git clean -xdf
echo "Updating CHANGELOG"
github_changelog_generator --future-release "$1" --bugs-label "**Fixed Bugs**" --enhancement-label "**Enhancements**" --issues-label "**Closed Issues**" --pr-label "**Merged Pull Requests**" --no-verbose
echo "Creating a compressed tarball of the source"
tar --exclude=".git" --exclude=".github" --exclude="homebrew-brew" -cvzf "AppleSimulatorUtils-$1.tar.gz" .
echo "Updating brew repository with latest tarball and update applesimutils.rb"
cd homebrew-brew
git fetch
git checkout master
mv "../AppleSimulatorUtils-$1.tar.gz" .
sed -i '' -e 's/url .*/url '"'https:\/\/raw.githubusercontent.com\/wix\/homebrew-brew\/master\/AppleSimulatorUtils-$1.tar.gz'"'/g' applesimutils.rb
sed -i '' -e 's/sha256 .*/sha256 '"'"$(shasum -b -a 256 AppleSimulatorUtils-$1.tar.gz | awk '{ print $1 }')"'"'/g' applesimutils.rb
git add -A
git commit -m "$1"
git push
echo "Pushing submodule change"
cd ..
git add -A
git commit -m "$1"
git tag "$1"
git push
git push --tags
# version.h