forked from angular/material
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·57 lines (43 loc) · 1.51 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
#!/bin/bash
ARG_DEFS=(
"--version=(.*)"
"[--optional=([A-Za-z])]"
)
function run {
cd ../
if [[ "$GH_TOKEN" == "" ]]; then
echo "ERROR: Environment variable GH_TOKEN needed to push a release."
echo "Please set GH_TOKEN to a valid github push token for angular/material,"
echo "then try again."
exit 1
fi
echo "-- Building release..."
gulp build --release
echo "-- Cloning bower-material to dist..."
rm -rf dist/bower-material
git clone https://angular:[email protected]/angular/bower-material \
dist/bower-material
echo "-- Copying in build files..."
cp dist/angular-material* dist/bower-material
cd dist/bower-material
echo "-- Committing and tagging..."
replaceJsonProp "bower.json" "version" "$VERSION"
git add -A
git commit -am "release: version $VERSION"
git tag -f v$VERSION
echo "-- Pushing to bower material..."
git push -q origin master
git push -q origin v$VERSION
echo "-- Version $VERSION pushed successfully to angular/bower-material!"
echo "-- Updating package.json & bower.json in angular-material main..."
cd ../..
replaceJsonProp "bower.json" "version" "$VERSION"
replaceJsonProp "package.json" "version" "$VERSION"
echo "-- Committing, tagging and pushing bower.json and package.json..."
git commit bower.json package.json -m "release: version $VERSION"
git tag -f v$VERSION
git push -q origin master
git push -q origin v$VERSION
echo "-- Version $VERSION pushed successfully to angular/material!"
}
source $(dirname $0)/utils.inc