diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 54d7ceb..f0382a0 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -32,7 +32,7 @@ RUN wget https://downloads.sourceforge.net/reactos/RosBE-Unix-2.2.1.tar.bz2 \ && rm -rf RosBE-Unix-2.2.1 RUN git clone https://github.com/reactos/Release_Engineering \ - && mv Release_Engineering/Release_* /usr/local/bin \ + && mv Release_Engineering/Scripts/* /usr/local/bin \ && rm -rf Release_Engineering CMD ["/usr/local/RosBE/RosBE.sh", "/work"] diff --git a/Docker/README.md b/Docker/README.md index 4e7de45..a8d60ea 100644 --- a/Docker/README.md +++ b/Docker/README.md @@ -23,6 +23,15 @@ Below steps outline the process of running it locally. ## Building a release +### *Using the new release script* +```bash +git clone https://github.com/reactos/reactos.git +cd reactos +git checkout releases/0.4.15 +release +``` + +### *Using the old release script* ```bash Release_Configure # Answer the prompts diff --git a/Release_Configure b/Scripts/Release_Configure old mode 100755 new mode 100644 similarity index 100% rename from Release_Configure rename to Scripts/Release_Configure diff --git a/Release_ISOs b/Scripts/Release_ISOs old mode 100755 new mode 100644 similarity index 100% rename from Release_ISOs rename to Scripts/Release_ISOs diff --git a/Release_Source b/Scripts/Release_Source old mode 100755 new mode 100644 similarity index 100% rename from Release_Source rename to Scripts/Release_Source diff --git a/Scripts/release b/Scripts/release new file mode 100644 index 0000000..3027883 --- /dev/null +++ b/Scripts/release @@ -0,0 +1,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 "*******************************************************************************"