-
Notifications
You must be signed in to change notification settings - Fork 63
/
release.sh
executable file
·78 lines (59 loc) · 2.25 KB
/
release.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
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
########################################
# Create Git Release
#
# Usage:
# ./release.sh
########################################
echo 'Create release';
# =============================================================================
# Generate latest version of files
# =============================================================================
# generated minified files
grunt prod
# generated unminified files
grunt sass:releaseUnmin
grunt uglify:releaseUnmin
# =============================================================================
# Switch to new repo for release
# =============================================================================
# delete branch release if it already exists
git branch -D release
# create fresh branch release
git checkout -b release
# =============================================================================
# Add compiled files to repo
# =============================================================================
# force add compiled files
git add -f css/style.css
git add -f css/style.min.css
git add -f js/javascript.js
git add -f js/javascript.min.js
# =============================================================================
# Delete this release.sh file from the repo
# =============================================================================
git rm release.sh
git commit -m 'add compiled files and remove release.sh script'
# =============================================================================
# Get the version number
# =============================================================================
while [ -z $version ]; do
read -e -p "Version Tag (e.g. 0.6.1): " version
if [ -z $version ]; then
cecho "You must enter a Version Tag" red
fi
done
# =============================================================================
# Publish the release
# =============================================================================
# tag the relase
git tag -a $version -m 'Stable version'
# Push tags to the repo
git push --tags
# =============================================================================
# Cleanup
# =============================================================================
# switch to master branch
git checkout master
# delete the release branch
git branch -D release