-
Notifications
You must be signed in to change notification settings - Fork 2
/
release.sh
executable file
·56 lines (48 loc) · 1.08 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
#!/usr/bin/env bash
set -ue
ref=$1
depthopt=''
if find . -depth 1 >/dev/null 2>/dev/null; then
depthopt='-depth'
else
depthopt='-maxdepth'
fi
rm -rf repo/
if [[ ${ref:0:1} == "v" ]]; then
name=$ref
git clone https://github.com/angular/angular.js.git repo/ --branch "$ref" --depth 1
cd repo/
else
git clone https://github.com/angular/angular.js.git repo/
cd repo/
git checkout $ref
name=$(git describe --tags)
fi
source ../build/$(git describe --tags --abbrev=0).sh
cd build/
IFS=$'\n' LINES=($(find . $depthopt 1 | grep -v '\.min\.js$' | awk '{print "\"" $0 "\""}'))
MAIN=$(printf ", %s" "${LINES[@]}")
MAIN=${MAIN:1}
cat <<EOF > bower.json
{
"name": "angular-complete",
"version": "$name",
"description": "All AngularJS releases, including core directives and i18n files",
"keywords": [
"angular",
"angularjs",
"directive",
"directives",
"i18n",
"internationalization"
],
"main": [ $MAIN ],
"license": "MIT"
}
EOF
git init
cp ../../.git/config .git/
git add -A
git commit -m "$name" --no-verify
git tag "$name"
git push origin --tags -f