Skip to content

Commit 31d4294

Browse files
committed
Streamlined new-version announcement method
1 parent 253d854 commit 31d4294

File tree

4 files changed

+297
-19
lines changed

4 files changed

+297
-19
lines changed

how_to_release.txt

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,16 @@ UPLOAD INSTALLER
7474

7575
DO ANNOUNCEMENT
7676

77-
1. Copy previous announcement from forum and paste into Crimson Editor
78-
2. Change version number (eg. 4.53 to 4.54) and executable file name: (eg. 453 to 454)
79-
3. Near the end change the "git diff" and "git log" lines to update the *previous* version (eg. 4.52 to 4.53)
80-
4. Run the updated "git diff" and "git log" commands, pasting the results into the announcement (see below)
81-
5. Update the size of the installer (eg. from 2.79 Mb to 2.80 Mb)
82-
6. Update the MD5sum hex figure in the announcement
83-
7. Amend the "improvements" lines in the announcement to reflect the major changes
84-
8. Paste resulting message into a new forum message announcing the new release
85-
9. Find the post number of that new message and amend forum database table bbsection, record 1 (MUSHclient section) to show the latest release and forum post to read about it.
86-
87-
88-
Run this code in the Immediate window of MUSHclient to convert the "git log" lines to have hyperlinks:
89-
----------------------
90-
for x, desc in string.gmatch (GetClipboard (), "(%x+) ([^\n]+)") do
91-
print (string.format (
92-
'<a href="http://github.com/nickgammon/mushclient/commit/%s">%s</a> %s',
93-
x, x, FixupHTML (desc)))
94-
end -- for
95-
----------------------
77+
1. Update the "version" table on the database (record ID 0) to have the release information.
78+
Use "*" for bullet points in the description.
79+
80+
2. Load the plugin Make_Announcement.xml from the source/install directory
81+
82+
3. Type "make_announcement" to generate the announcement from the template with the hash etc. included
83+
84+
4. Paste the resulting announcement into a new forum message announcing the new release
85+
86+
5. Find the post number of that new message and amend forum database table bbsection, record 1 (MUSHclient section) to show the latest release and forum post to read about it.
9687

9788

9889

install/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
Make Installer.lnk
22
*.exe
3+
git_diff_output.txt
4+
git_log_output.txt

install/Make_Announcement.xml

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<?xml version="1.0" encoding="iso-8859-1"?>
2+
<!DOCTYPE muclient>
3+
4+
<muclient>
5+
<plugin
6+
name="Make_Announcement"
7+
author="Nick Gammon"
8+
id="0aab03f457948d2a21141b50"
9+
language="Lua"
10+
purpose="Makes the announcement for a new version of MUSHclient"
11+
date_written="2010-11-15"
12+
requires="4.60"
13+
version="1"
14+
>
15+
<description trim="y">
16+
<![CDATA[
17+
18+
Type: make_announcement
19+
20+
]]>
21+
</description>
22+
23+
</plugin>
24+
25+
<!-- Aliases -->
26+
27+
<aliases>
28+
<alias
29+
name="make_announcement"
30+
script="make_announcement"
31+
match="make_announcement"
32+
enabled="y"
33+
sequence="100"
34+
>
35+
</alias>
36+
</aliases>
37+
38+
39+
40+
41+
<!-- Script -->
42+
43+
44+
<script>
45+
<![CDATA[
46+
47+
VERSION_URL = "http://www.mushclient.com/scripts/version.php"
48+
49+
SOURCE = "c:\\source\\mushclient\\install\\"
50+
51+
TEMPLATE = "announcement_template.txt"
52+
GIT_DIFF_FILE = "git_diff_output.txt"
53+
GIT_LOG_FILE = "git_log_output.txt"
54+
55+
GIT_HUB = "http://github.com/nickgammon/mushclient"
56+
57+
function make_announcement ()
58+
59+
60+
-- grab updated MUSHclient info from web site
61+
local http = require "socket.http"
62+
63+
SetStatus "Checking for latest MUSHclient version ..."
64+
local page = http.request (VERSION_URL)
65+
SetStatus "Ready"
66+
67+
if not page then return end -- page doesn't exist
68+
69+
local s = string.match (page, "<pre>(.*)</pre>")
70+
71+
if not s then return end -- page in wrong format
72+
73+
local t = {}
74+
setfenv (assert (loadstring (s)), t) () -- compile and load into t
75+
76+
info = t.installer_info
77+
78+
if not info then return end -- installer_info not there
79+
80+
-- grab version number and other stuff from that page
81+
82+
new_version = tonumber (info.version)
83+
previous_version = string.format ("%0.2f", new_version - 0.01)
84+
installer_size = string.format ("%0.2f", info.installer_size / 1024 / 1024)
85+
installer_file = string.match (info.installer_url, "[%w_.]+$")
86+
description = string.gsub ("\n" .. FixupHTML (info.description), "\n%*", "<li>")
87+
88+
-- remove any old interim files
89+
os.remove (SOURCE .. GIT_DIFF_FILE)
90+
os.remove (SOURCE .. GIT_LOG_FILE)
91+
92+
-- do the git diff for this version and the previous one
93+
assert (utils.shellexecute ("git",
94+
string.format ("--no-pager diff v%s..v%s --stat > "
95+
.. GIT_DIFF_FILE,
96+
previous_version, info.version),
97+
SOURCE))
98+
99+
-- do the git log for this version and the previous one
100+
assert (utils.shellexecute ("git",
101+
string.format ("--no-pager log --pretty=oneline --reverse --abbrev-commit v%s..v%s > "
102+
.. GIT_LOG_FILE,
103+
previous_version, info.version),
104+
SOURCE))
105+
106+
-- give them time to finish
107+
utils.msgbox "press <OK> when DOS windows closed"
108+
109+
-- get template of announcement
110+
local f = assert (io.open (SOURCE .. TEMPLATE, "r"))
111+
local template = f:read ("*a")
112+
f:close ()
113+
114+
-- get git diff
115+
local f = assert (io.open (SOURCE .. GIT_DIFF_FILE, "r"))
116+
local git_diff = FixupHTML (f:read ("*a"))
117+
f:close ()
118+
119+
-- get git log
120+
local f = assert (io.open (SOURCE .. GIT_LOG_FILE, "r"))
121+
local git_raw_log = f:read ("*a")
122+
f:close ()
123+
124+
-- fix up log to have hyperlinks
125+
local t = {}
126+
127+
for commit_code, desc in string.gmatch (git_raw_log, "(%x+) ([^\n]+)") do
128+
table.insert (t, string.format (
129+
'<a href="%s/commit/%s">%s</a> %s',
130+
GIT_HUB,
131+
commit_code,
132+
commit_code,
133+
FixupHTML (desc)))
134+
end -- for
135+
136+
local git_log = table.concat (t, "\n")
137+
138+
-- table of replacements
139+
replacements = {
140+
141+
["<<version>>"] = info.version,
142+
["<<previous_version>>"] = previous_version,
143+
["<<installer_hash>>"] = info.installer_hash,
144+
["<<installer_size>>"] = installer_size,
145+
["<<installer_url>>"] = info.installer_url,
146+
["<<installer_file>>"] = installer_file,
147+
["<<description>>"] = description,
148+
["<<git_diff>>"] = git_diff,
149+
["<<git_log>>"] = git_log,
150+
151+
} -- end of replacements
152+
153+
-- do the replacements
154+
template = string.gsub (template, "<<[%w_]+>>", replacements)
155+
156+
-- output to MUSHclient window for checking
157+
print (string.rep ("-", 80))
158+
ColourNote ("cyan", "", template)
159+
print (string.rep ("-", 80))
160+
161+
-- fix up newlines
162+
template = string.gsub (template, "\r", "")
163+
template = string.gsub (template, "\n", "\r\n")
164+
165+
-- put onto clipboard
166+
SetClipboard (template)
167+
ColourNote ("green", "", "(Copied to clipboard)")
168+
169+
end -- make_announcement
170+
171+
172+
ColourNote ("cyan", "", "Type: make_announcement")
173+
174+
]]>
175+
</script>
176+
177+
</muclient>

install/announcement_template.txt

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<p>I am pleased to release <a href="<<installer_url>>">version <<version>> of MUSHclient</a>. See the <a href="http://www.gammon.com.au/scripts/showrelnote.php?version=<<version>>&productid=0">release notes</a> for more details.</p>
2+
3+
4+
<p><b>Improvements</b></p>
5+
<ul>
6+
<<description>>
7+
</ul>
8+
9+
<hr>
10+
<h3>Download</h3>
11+
12+
<p>You can <a href="http://www.gammon.com.au/scripts/showrelnote.php?version=<<version>>&productid=0">view the release notes for version <<version>></a></p>
13+
14+
<table border=0 cellpadding=10>
15+
<tr valign=top><td bgcolor="#B9EF87">
16+
17+
<p>
18+
You can download MUSHclient <<version>> now from ...
19+
</p>
20+
21+
<ul>
22+
<li>
23+
<a href="<<installer_url>>"><<installer_url>></a>
24+
(<<installer_size>> Mb).
25+
</ul>
26+
27+
</td></tr>
28+
</table>
29+
30+
<p>You are strongly advised to <b>backup</b> (make a copy of) your existing MUSHclient world files before upgrading. Just in case.</p>
31+
32+
<p>
33+
If there are any problems, please post messages to the Bug Reports, Suggestions, or General parts of this forum.
34+
</p>
35+
36+
37+
38+
<hr>
39+
40+
<b>MD5 sum for the installer</b>
41+
42+
<p>If you do an md5sum on <<installer_file>> you should get this result:</p>
43+
44+
<p><mono>
45+
<<installer_hash>>
46+
</mono></p>
47+
48+
<p>The forum post <a href="http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=7280">a small script to sumcheck the MUSHclient download</a> shows how you can write a small script in MUSHclient to do the sumcheck. It also lists some places you can download md5sum.exe to do the sumcheck (if this is the first time you have downloaded MUSHclient).</p>
49+
50+
<p>One way of doing an md5sum is to download the <a href="http://www.gammon.com.au/mushclient/plugins/Installer_sumcheck.xml">Installer_sumcheck</a> plugin from the Plugins page (RH click that link and "save link as" to get the plugin). Then install the plugin (see the File menu -&gt; Plugins) and type "md5sum" which lets you browse to the installer file, load it, and display the sumcheck.</p>
51+
52+
53+
<hr>
54+
<font size=-2>
55+
<h3><font color="red">Message about "Failed to load resources file"</font></h3>
56+
57+
<p>Some users are reporting getting a message like "Failed to load resources file: C:\Programme\MUSHclient\locale\DE.dll - trying English file" when starting MUSHclient (the DE.dll part might be another language like FR.dll).
58+
</p>
59+
60+
<p>This will be because you have customized the "locale" of MUSHclient to other than EN (English).
61+
See the <a href="http://www.gammon.com.au/forum/?id=7953">How to localize MUSHclient messages into other languages</a> forum posting for more details about localization.</p>
62+
63+
<p>To fix this, find the directory you installed MUSHclient into (eg. "C:\Program Files\MUSHclient\") and then locate the subdirectory "locale". In that you will find a file en.dll. Copy or rename that file to match the missing file in the message (eg. copy en.dll to de.dll).</p>
64+
65+
<p><b>Alternative suggestion:</b> Go into the File menu -> Global Preferences -> General, and change the field "Locale code" back to "EN" (English) and then it should look for EN.DLL next time.</p>
66+
67+
<hr>
68+
<h3><font color="red">Warning about Lua 5.1 upgrade (September 2006)</font></h3>
69+
70+
<p>MUSHclient version 3.80 upgraded the Lua script engine from Lua 5.0.2 to 5.1.1. If you are upgrading to this version from an earlier version than 3.80, you should read <a href="http://www.gammon.com.au/forum/?id=7341">Version 3.80 released - with Lua 5.1 script engine</a> - this post has recommendations about what is required if you use Lua scripting or Lua plugins. <b>Note:</b> Since version 3.80 was released, the version of Lua has been upgraded. It is currently 5.1.4. Some versions (versions 4.49 to 4.52 of MUSHclient) may incorrectly report they are using Lua 5.1.1 when you open a world.</p>
71+
72+
<hr>
73+
<h3><font color="red">Warning about upgrading from versions prior to 3.21 (May 2002)</font></h3>
74+
75+
<p>MUSHclient version 3.85 (onwards) no longer reads the old "binary" world files produced by versions prior to 3.21. For more information about this please read the forum post <a href="http://www.gammon.com.au/forum/?id=7687">Versions 3.85 onwards no longer support world files created prior to version 3.21</a> - this post has recommendations about how to upgrade your world files if you are upgrading from a version earlier than 3.21.</p>
76+
77+
<p>Note that version 3.21 was released quite a few years ago (May 2002), so people who have recently installed MUSHclient should not have any problems.</p>
78+
79+
</font>
80+
<hr>
81+
<h3>Source code</h3>
82+
83+
<p>The source code for this version is available from GitHub:</p>
84+
85+
<p><a href="http://github.com/nickgammon/mushclient/tree/v<<version>>">http://github.com/nickgammon/mushclient/tree/v<<version>></a></p>
86+
87+
<p>You can directly download the source from the Downloads page (<a href="http://github.com/nickgammon/mushclient/downloads">http://github.com/nickgammon/mushclient/downloads</a>), or preferably install Git and use the appropriate commands to clone or pull the source. For some suggestions about getting the source from Git see <a href="http://www.gammon.com.au/forum/?id=10019">MUSHclient source being made available on GitHub</a> forum posting.</p>
88+
89+
<p>If you install Git, subsequent downloads (of new versions) will be much faster as it only needs to download the changes, not the whole source. Also by using Git you can find out exactly what has changed from version to the next.</p>
90+
91+
<h4>Summary of changes in this version</h4>
92+
<code><pre>
93+
94+
$ <b>git --no-pager diff v<<previous_version>>..v<<version>> --stat</b>
95+
96+
<<git_diff>>
97+
98+
</pre></code>
99+
100+
<h4>Commit log (date order)</h4>
101+
<code><pre>
102+
103+
$ <b>git --no-pager log --pretty=oneline --reverse --abbrev-commit v<<previous_version>>..v<<version>></b>
104+
105+
<<git_log>>
106+
107+
</pre></code>
108+

0 commit comments

Comments
 (0)