-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprodrelease
executable file
·110 lines (97 loc) · 4.29 KB
/
prodrelease
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#! /bin/bash
#
# Service operations for a JMRI test release
# Argument is release version number, e.g. 4.5.8
# - Download a test release from Jenkins and unpack
# - Move files to SF.net FRS
# - Display the checksums
# - Display sample text for releaselist file
# - Display sample text for JMRI release note
# change this to test to copy into SF.net test release area
DEST="production"
# Download a test release from Jenkins and move it to SF.net FRS
curl -o release.zip "http://jmri.tagadab.com/jenkins/job/TestReleases/job/$1/lastSuccessfulBuild/artifact/dist/release/*zip*/release.zip"
rm release/JMRI*
unzip release.zip
cd release
# Move files to SF.net FRS
scp JMRI.* ${USER}@"frs.sourceforge.net:/home/frs/project/j/jm/jmri/${DEST}\ files/"
# Decide command to create checksums
if [ -x /usr/bin/hdiutil ]
then
SYSTEM=MACOSX
else
SYSTEM=LINUX
fi
if [ "$SYSTEM" = "MACOSX" ]
then
SHA="shasum -a 256"
else
SHA="sha256sum"
fi
# Create and display the checksums
$SHA JMRI*
# Display sample text for releaselist file
echo
echo "releaselist:"
echo '----------------------------------------------------------------------------------'
echo " ${1}:"
echo " tgz: "\""https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.tgz`"\"
echo " dmg: "\""https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.dmg`"\"
echo " exe: "\""https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.exe`"\"
echo '----------------------------------------------------------------------------------'
echo
echo
# Display sample text for JMRI release note
echo "release note:"
echo '----------------------------------------------------------------------------------'
echo '<ul>'
echo '<li>OS X / macOS: <a'
echo " href="\""https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.dmg`"\"">https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.dmg`</a><br/>"
echo " sha256: `$SHA *.dmg| awk '{print $1}'` </p>"
echo
echo '<li>Windows: <a'
echo " href="\""https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.exe`"\"">https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.exe`</a><br/>"
echo " sha256: `$SHA *.exe| awk '{print $1}'`</p>"
echo
echo '<li>Linux: <a'
echo " href="\""https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.tgz`"\"">https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.tgz`</a><br/>"
echo " sha256: `$SHA *.tgz| awk '{print $1}'`</p>"
echo '</ul>'
echo '----------------------------------------------------------------------------------'
echo
echo
# Display sample text for JMRI release note
echo "Older release note format using Sf.net:"
echo '----------------------------------------------------------------------------------'
echo '<ul>'
echo '<li>OS X / macOS: <a'
echo " href="\""https://sourceforge.net/projects/jmri/files/${DEST}%20files/`ls *.dmg`/download"\"">https://sourceforge.net/projects/jmri/files/${DEST}%20files/`ls *.dmg`/download</a><br/>"
echo " sha256: `$SHA *.dmg| awk '{print $1}'` </p>"
echo
echo '<li>Windows: <a'
echo " href="\""https://sourceforge.net/projects/jmri/files/${DEST}%20files/`ls *.exe`/download"\"">https://sourceforge.net/projects/jmri/files/${DEST}%20files/`ls *.exe`/download</a><br/>"
echo " sha256: `$SHA *.exe| awk '{print $1}'`</p>"
echo
echo '<li>Linux: <a'
echo " href="\""https://sourceforge.net/projects/jmri/files/${DEST}%20files/`ls *.tgz`/download"\"">https://sourceforge.net/projects/jmri/files/${DEST}%20files/`ls *.tgz`/download</a><br/>"
echo " sha256: `$SHA *.tgz| awk '{print $1}'`</p>"
echo '</ul>'
echo '----------------------------------------------------------------------------------'
echo
echo
# Display sample text for GitHub release note
echo "Github note body:"
echo '----------------------------------------------------------------------------------'
echo
echo "[Release notes](http://jmri.org/releasenotes/jmri${1}.shtml)"
echo
echo 'Checksums:'
echo
echo 'File | SHA256 checksum'
echo '---|---'
echo "[`ls *.dmg`](https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.dmg`) | `$SHA *.dmg| awk '{print $1}'`"
echo "[`ls *.exe`](https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.exe`) | `$SHA *.exe| awk '{print $1}'`"
echo "[`ls *.tgz`](https://github.com/JMRI/JMRI/releases/download/v${1}/`ls *.tgz`) | `$SHA *.tgz| awk '{print $1}'`"
echo
echo '----------------------------------------------------------------------------------'