-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathrelease
More file actions
128 lines (112 loc) · 4.35 KB
/
release
File metadata and controls
128 lines (112 loc) · 4.35 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/bash
# Constants
ROOTDIR="$PWD"
OPTMODDIR="modules/optional"
OUTPUTDIR="output-MinGW-i386"
echo "*******************************************************************************"
echo "* ReactOS Release Script *"
echo "*******************************************************************************"
echo
# Ensure we are in RosBE.
if [ "$ROS_ARCH" = "" ]; then
echo "Please run this script inside RosBE!"
exit 1
fi
# Ensure this is running inside a git directory.
if [ ! -d "${ROOTDIR}/.git" ]; then
echo "Please run this script inside a ReactOS git directory. Release aborted."
exit 1
fi
# Check for internet connection.
wget -q --spider https://reactos.org
if [ $? -eq 0 ]; then
internet=true
else
echo "Warning! No internet connection detected."
echo "Optional modules cannot be downloaded and origin cannot be fetched."
echo
fi
# Get version (ex: 0.4.15-4-ge1e96bf467b5ea).
version=$(git describe)
# Remove git hash at end of the version.
version=${version%-*}
# Change "release" to "rls", if it is in the version name.
version=${version/release/rls}
# Get the branch name.
branch_name=$(git rev-parse --abbrev-ref HEAD)
echo "ReactOS version is ${version}"
echo "ReactOS branch name is ${branch_name}"
echo
# Ensure version and branch name are not null.
if [ "$version" = "" ] || [ "$branch_name" = "" ]; then
echo "Version or branch name is NULL! Release aborted."
exit 1
fi
# Clean repository, excluding the modules/optional folder and its contents.
git clean -d -f -f -x --exclude="/modules/optional/*" || exit 1
# Fetch changes from origin if we have an internet connection.
if [ "$internet" ]; then
git fetch origin || exit 1
fi
# Reset to the head of the branch
git reset --hard HEAD || exit 1
echo
# Download the "optional" folder from svn.reactos.org if it isn't already downloaded.
# Ensure the optional modules folder is there and contains the modules we need.
if [ -d "${OPTMODDIR}" ] && [ -f "${OPTMODDIR}/DroidSansFallback.ttf" ] && compgen -G "${OPTMODDIR}/wine_gecko*.msi" > /dev/null; then
echo "Optional modules already downloaded. Skipping."
echo "If you have an issue with the optional modules, re-run this script after deleting the directory:"
echo " ${ROOTDIR}/${OPTMODDIR}"
elif [ "${internet}" ]; then
echo "Downloading optional modules..."
if [ -d "${OPTMODDIR}" ]; then
rm -rf "${OPTMODDIR}" || exit 1
fi
mkdir "${OPTMODDIR}" || exit 1
cd "${OPTMODDIR}" || exit 1
wget --recursive --level=1 --no-directories --no-parent --execute robots=off "https://svn.reactos.org/optional" || exit 1
# Check that all mandatory files were downloaded.
if [ ! -f "DroidSansFallback.ttf" ]; then
echo "DroidSansFallback CJK font missing!"
exit 1
fi
if ! compgen -G "wine_gecko*.msi" > /dev/null; then
echo "wine_gecko MSI package missing!"
exit 1
fi
else
echo "Missing optional modules and no internet connection. Release aborted."
exit 1
fi
echo
# BootCD and LiveCD deliverable constants
BOOTCDISO="ReactOS-${version}-${ROS_ARCH}-boot.iso"
BOOTCDZIP="ReactOS-${version}-${ROS_ARCH}-boot.zip"
LIVECDISO="ReactOS-${version}-${ROS_ARCH}-live.iso"
LIVECDZIP="ReactOS-${version}-${ROS_ARCH}-live.zip"
EXPORTDIR="ReactOS-${version}"
SOURCEZIP="ReactOS-${version}-src.zip"
# Build ReactOS
cd "${ROOTDIR}" || exit 1
./configure.sh -DENABLE_ROSAPPS=1 -DENABLE_WALLPAPERS=1 || exit 1
cd "${OUTPUTDIR}" || exit 1
ninja bootcd || exit 1
ninja livecd || exit 1
# Create the ZIP packages for BootCD and LiveCD
echo "Creating BootCD and LiveCD ZIP packages..."
mv "bootcd.iso" "${BOOTCDISO}" || exit 1
zip -9 "${ROOTDIR}/${BOOTCDZIP}" "${BOOTCDISO}" || exit 1
mv "livecd.iso" "${LIVECDISO}" || exit 1
zip -9 "${ROOTDIR}/${LIVECDZIP}" "${LIVECDISO}" || exit 1
# Create the ZIP package for the source deliverable
echo "Creating source ZIP package..."
cd "${ROOTDIR}"
git archive --format=zip --prefix="${EXPORTDIR}/" -9 --output="${ROOTDIR}/${SOURCEZIP}" "${branch_name}" || exit 1
# We're done!
echo
echo "*******************************************************************************"
echo "Successfully created the following packages:"
echo " ${ROOTDIR}/${BOOTCDZIP}"
echo " ${ROOTDIR}/${LIVECDZIP}"
echo " ${ROOTDIR}/${SOURCEZIP}"
echo "*******************************************************************************"