win,msi: broadcast WM_SETTINGCHANGE after install
[platform/upstream/nodejs.git] / tools / node-release-post-build.sh
1 #!/bin/bash
2
3 ## This is to be used once jenkins has finished building the release
4
5 set -e
6
7 if [[ ! -e ../node-website/Makefile ]];
8 then
9   echo "node-website must be checked out one level up"
10   exit 1
11 fi
12
13 stability="$(python tools/getstability.py)"
14 NODE_STABC="$(tr '[:lower:]' '[:upper:]' <<< ${stability:0:1})${stability:1}"
15 NODE_STABL="$stability"
16
17 echo "Building for $stability"
18
19 scp tj@nodejs.org:archive/node/tmp/v$(python tools/getnodeversion.py)/SHASUM* .
20 FILES="SHASUMS SHASUMS256"
21 for i in $FILES ; do gpg -s $i.txt; gpg --clearsign $i.txt; done
22 scp SHASUM* tj@nodejs.org:archive/node/tmp/v$(python tools/getnodeversion.py)/
23  
24 ssh nodejs.org mkdir -p "dist/v$(python tools/getnodeversion.py)/{x64,docs}"
25 ssh nodejs.org ln -s ../dist/v$(python tools/getnodeversion.py)/docs docs/v$(python tools/getnodeversion.py)
26
27 ssh root@nodejs.org mv /home/tj/archive/node/tmp/v$(python tools/getnodeversion.py)/* /home/node/dist/v$(python tools/getnodeversion.py)/
28 ssh root@nodejs.org chown -R node:other /home/node/dist/v$(python tools/getnodeversion.py)
29
30 # tag the release
31 # should be the same key used to sign the shasums
32 git tag -sm "$(bash tools/changelog-head.sh)" v$(python tools/getnodeversion.py)
33  
34 # push to github
35 git push git@github.com:joyent/node v$(python tools/getnodeversion.py)-release --tags 
36
37 # blog post and email
38 make email.md
39 ( echo ""
40   echo "Shasums:"
41   echo '```'
42   cat SHASUMS.txt.asc
43   echo '```' ) >> email.md
44 ( echo -n "date: "
45   date
46   echo -n "version: "
47   python tools/getnodeversion.py
48   echo "category: release"
49   echo "title: Node v"$(python tools/getnodeversion.py)" ($NODE_STABC)"
50   echo "slug: node-v"$(python tools/getnodeversion.py | sed 's|\.|-|g')"-$NODE_STABL"
51   echo ""
52   cat email.md ) > ../node-website/doc/blog/release/v$(python tools/getnodeversion.py).md
53
54 if [ "$stability" = "stable" ];
55 then
56   ## this needs to happen here because the website depends on the current node
57   ## node version
58   ## this will get the api docs in the right place
59   make website-upload
60   BRANCH="v$(python tools/getnodeversion.py | sed -E 's#\.[0-9]+$##')"
61   echo $(python tools/getnodeversion.py) > ../node-website/STABLE
62 else
63   BRANCH="master"
64 fi
65
66 echo "Merging back into $BRANCH"
67
68 # merge back into mainline stable branch
69 git checkout $BRANCH
70 git merge --no-ff v$(python tools/getnodeversion.py)-release
71  
72 # change the version number, set isrelease = 0
73 ## TODO automagic.
74 vim src/node_version.h
75 git commit -am "Now working on "$(python tools/getnodeversion.py)
76
77 git push git@github.com:joyent/node $BRANCH
78
79 echo "Now go do the website stuff"