summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2019-05-06 15:41:12 -0300
committerHisham Muhammad <hisham@gobolinux.org>2019-05-06 15:41:12 -0300
commit9cb923d86dec6af01d4b4fc93ad1b03b1d18c794 (patch)
tree92bc39b3d957ce4df8bcf1181c5b87d87e408f12
parent505790352ef01da959154da9a2be270a6c21212d (diff)
downloadluarocks-9cb923d86dec6af01d4b4fc93ad1b03b1d18c794.tar.gz
luarocks-9cb923d86dec6af01d4b4fc93ad1b03b1d18c794.tar.bz2
luarocks-9cb923d86dec6af01d4b4fc93ad1b03b1d18c794.zip
add publishrelease script
-rwxr-xr-xpublishrelease197
1 files changed, 197 insertions, 0 deletions
diff --git a/publishrelease b/publishrelease
new file mode 100755
index 00000000..b464a852
--- /dev/null
+++ b/publishrelease
@@ -0,0 +1,197 @@
1#!/usr/bin/env bash
2
3[ "$1" ] || {
4 echo "usage.....: $0 <version>"
5 echo "example...: $0 3.1.1"
6 echo
7 echo "Before running this, make sure the packages were built:"
8 echo " makedist 3.1.1 binary sign"
9 echo "And the tag was merged:"
10 echo " mergerelease 3.1.1"
11 echo
12 exit 1
13}
14
15#######################################
16# preliminary checks
17#######################################
18
19v="$1"
20
21git checkout v$v || {
22 echo "Could not checkout release tag."
23}
24
25packages=(
26 luarocks-$v-windows-32.zip
27 luarocks-$v-windows-32.zip.asc
28 luarocks-$v-linux-x86_64.zip
29 luarocks-$v-linux-x86_64.zip.asc
30 luarocks-$v-win32.zip
31 luarocks-$v-win32.zip.asc
32 luarocks-$v.tar.gz
33 luarocks-$v.tar.gz.asc
34)
35
36for f in "${packages[@]}" luarocks-$v-1.rockspec
37do
38 [ -e "$f" ] || {
39 echo "Missing file $f"
40 exit 1
41 }
42done
43
44#######################################
45# utility
46#######################################
47
48function confirm() {
49 branch="$1"
50
51 echo "****************************************"
52 git diff $branch
53 echo "****************************************"
54 git status
55 echo "****************************************"
56
57 echo "Everything looks all right? (y/n)"
58 echo "(Answering y will commit and push)"
59 read
60 if ! [ "$REPLY" == "y" ]
61 then
62 git reset
63 git checkout .
64 git checkout master
65 exit 1
66 fi
67}
68
69#######################################
70# gh-pages
71#######################################
72
73git checkout gh-pages
74git fetch origin gh-pages
75git reset --hard origin/gh-pages
76
77cp "${packages[@]}" releases
78cd releases
79git add "${packages[@]}"
80gawk '
81/add new release here/ {
82 print "<!-- add new release here -->"
83 print ""
84 print "<tr><td><a href=\"luarocks-'$v'.tar.gz\">luarocks-'$v'.tar.gz</a></td><td><a href=\"luarocks-'$v'.tar.gz.asc\">PGP signature</a></td></tr>"
85 print "<tr><td><a href=\"luarocks-'$v'-windows-32.zip\">luarocks-'$v'-windows-32.zip</a> (luarocks.exe stand-alone Windows binary)</td><td><a href=\"luarocks-'$v'-windows-32.zip.asc\">PGP signature</a></td></tr>"
86 print "<tr><td><a href=\"luarocks-'$v'-linux-x86_64.zip\">luarocks-'$v'-linux-x86_64.zip</a> (luarocks stand-alone Linux x86_64 binary)</td><td><a href=\"luarocks-'$v'-linux-x86_64.zip.asc\">PGP signature</a></td></tr>"
87 print "<tr><td><a href=\"luarocks-'$v'-win32.zip\">luarocks-'$v'-win32.zip</a> (legacy Windows package, includes Lua 5.1)</td><td><a href=\"luarocks-'$v'-win32.zip.asc\">PGP signature</a></td></tr>"
88 done = 1
89}
90// {
91 if (done == 1) {
92 done = 0
93 } else {
94 print
95 }
96}
97' index.html > index.html.1
98mv index.html.1 index.html
99git add index.html
100
101gawk '
102/^\[$/ {
103 go = 1
104}
105// {
106 print
107 if (go == 1) {
108 go = 0
109
110 print "{"
111 print "\"'$v'\": {"
112 print "\"date\": \"'$(date +'%Y-%m-%d')'\","
113 print "\"files\": [\"luarocks-'$v'.tar.gz\", \"luarocks-'$v'.tar.gz.asc\", \"luarocks-'$v'-win32.zip\", \"luarocks-'$v'-win32.zip.asc\", \"luarocks-'$v'-windows-32.zip\", \"luarocks-'$v'-windows-32.zip.asc\", \"luarocks-'$v'-linux-x86_64.zip\", \"luarocks-'$v'-linux-x86_64.zip.asc\"],"
114 print "\"about\": []"
115 print "}},"
116 }
117}
118' releases.json > releases.json.1
119mv releases.json.1 releases.json
120git add releases.json
121
122confirm gh-pages
123
124git commit -av -m "Release $v"
125git push
126
127#######################################
128# luarocks.org
129#######################################
130
131git checkout v$v
132
133luarocks upload luarocks-$v-1.rockspec
134
135git checkout master
136
137#######################################
138# luarocks-site
139#######################################
140
141if [ -e ../luarocks-site ]
142then
143 cd ../luarocks-site
144else
145 cd ..
146 git clone https://github.com/luarocks/luarocks-site
147 cd luarocks-site
148fi
149
150git pull
151sed -i 's,luarocks-[0-9]*\.[0-9]*\.[0-9]*,luarocks-'$v',' static/md/home.md
152git add static/md/home.md
153
154confirm master
155
156git commit static/md/home.md -m "update front page for LuaRocks $v"
157git push
158
159#######################################
160# luarocks.wiki
161#######################################
162
163[ -e ../luarocks.wiki ] || {
164 cd ..
165 git clone https://github.com/luarocks/luarocks.wiki.git
166}
167
168if [ -e ../luarocks.wiki ]
169then
170 cd ../luarocks.wiki
171else
172 cd ..
173 git clone https://github.com/luarocks/luarocks.wiki.git
174 cd luarocks.wiki
175fi
176
177sed -i "s,The current stable release is [^:]*:,The current stable release is '''$v''':," Download.mediawiki
178
179gawk '
180BEGIN {
181 print "'\'\'\''Version '$v\'\'\'' - '$(date +'%d/%b/%Y')' - [http://luarocks.org/releases/luarocks-'$v'.tar.gz All Unix] -"
182 print "[http://luarocks.org/releases/luarocks-'$v'-windows-32.zip Windows all-in-one executable]"
183 print ""
184}
185// {
186 print
187}
188' "Release-history.mediawiki" > "Release-history.mediawiki.1"
189mv "Release-history.mediawiki.1" "Release-history.mediawiki"
190
191git add "Download.mediawiki"
192git add "Release-history.mediawiki"
193
194confirm master
195
196git commit -av -m "Release $v"
197git push