-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease.sh
49 lines (43 loc) · 2.39 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
#! /usr/bin/env sh
I2P_DATE=$(date +%Y-%m-%d)
if [ -z "${I2P_OS}" ]; then
I2P_OS=mac
fi
if [ -z "${I2P_BRANCH}" ]; then
I2P_BRANCH=beta
fi
if [ -z "${I2P_DOWNLOAD}" ]; then
echo "\$I2P_DOWNLOAD is not set, an HTTP download will not be added to releases.json"
sleep 5s
fi
if [ -z "${I2P_VERSION}" ]; then
echo "\$I2P_VERSION not set, aborting"
exit 1
fi
## TODO:
#
# Once we're here, we'll need to...
# 1. take the .dmg and package it as an su3, then
# 2. generate a torrent file from that .su3, then
# 3. convert that torrent file to a magnet link,
# 4. store it in the variable MAGNET
## At which point, this will have all the information it needs to automatically
# generate the releases.json and put it into a neighboring i2p.newsxml checkout.
# The new workflow for i2p.newsxml will generate a newsfeed for each platform
# and branch using the a specific releases.json to set up the update.
echo "[" | tee ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " {" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"date\": \"$I2P_DATE\"," | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"version\": \"$I2P_VERSION\"," | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"minVersion\": \"1.5.0\"," | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"minJavaVersion\": \"1.8\"," | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"updates\": {" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"su3\": {" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"torrent\": \"$MAGNET\"," | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"url\": [" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " \"$I2P_DOWNLOAD\"" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " ]" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " }" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " }" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo " }" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json
echo "]" | tee -a ../i2p.newsxml/data/"$I2P_OS"/"$I2P_BRANCH"/releases.json