Skip to content

Consolidate release script #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Work directly on the git directory, restore old release scripts.
  • Loading branch information
cbialorucki committed Mar 26, 2025
commit 9d3bab48196b69e3caf6c459ee386e639dfdbc0b
9 changes: 9 additions & 0 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ 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
Release_ISOs
Release_Source
```
65 changes: 65 additions & 0 deletions Scripts/Release_Configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
# ReactOS Release Engineering Scripts
# Release_Configure - Set up a release configuration. First script to execute!

# Sanity checks
if [ "$ROS_ARCH" = "" ]; then
echo "Please run this script inside RosBE!"
exit 1
fi

# Constants
ORIGDIR="$PWD"
REPODIR="$PWD/Release_WorkDir/Repo"

echo "*******************************************************************************"
echo "* ReactOS Release Engineering Scripts *"
echo "*******************************************************************************"
echo

# Ask for the version
echo "What ReactOS version do you want to release? (e.g. \"0.4.12\")"
echo "This will be used as suffix for the built files."
echo "If this is an RC, just hit RETURN without entering anything to use a suffix determined by Git (e.g. \"0.4.12-RC-5-g8449527\")."
read version
echo

# Ask for the branch name
while [ "$branch_name" = "" ]; do
echo "What is the name of the Git branch? (e.g. \"releases/0.4.12\")"
read branch_name
echo
done

# Check out the Git repository
if [ -d "${REPODIR}/.git" ]; then
cd "${REPODIR}" || exit 1
git clean -d -f -f -x || exit 1
git remote set-url origin https://github.com/reactos/reactos.git || exit 1
git fetch origin || exit 1
git checkout "${branch_name}" || exit 1
git reset --hard "origin/${branch_name}" || exit 1
else
rm -rf "${REPODIR}"
git clone https://github.com/reactos/reactos.git "${REPODIR}" || exit 1
cd "${REPODIR}" || exit 1
git checkout "${branch_name}" || exit 1
fi

# Get the version from Git if none was entered.
if [ "${version}" = "" ]; then
# Output something like '0.4.15-4-ge1e96bf467b5ea'
version_with_hash=`git describe --always`
# Extract the part before the last dash to ignore the commit hash
version=${version_with_hash%-*}
fi

# Write the config file
cd "${ORIGDIR}"
echo "REPODIR=${REPODIR}" > Release_Config
echo "version=${version}" >> Release_Config
echo "branch_name=${branch_name}" >> Release_Config

# All done!
echo "Release configured!"
echo "Now you can use the other Release_* commands to create the packages."
72 changes: 72 additions & 0 deletions Scripts/Release_ISOs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
# ReactOS Release Engineering Scripts
# Release_ISOs - Create the "-iso.zip" and "-live.zip" packages

# Sanity checks
if ! source ./Release_Config; then
echo "Please run Release_Configure first!"
exit 1
fi

if [ "$ROS_ARCH" = "" ]; then
echo "Please run this script inside RosBE!"
exit 1
fi

if [ "$ROS_ARCH" = "i386" ]; then
ROS_PRETTY_ARCH="x86"
else
ROS_PRETTY_ARCH="$ROS_ARCH"
fi


# Constants
ROOTDIR="$PWD"
OUTPUTDIR="output-MinGW-i386"
BOOTCDISO="ReactOS-${version}-${ROS_PRETTY_ARCH}.iso"
BOOTCDZIP="ReactOS-${version}-${ROS_PRETTY_ARCH}-iso.zip"
LIVECDISO="ReactOS-${version}-${ROS_PRETTY_ARCH}-live.iso"
LIVECDZIP="ReactOS-${version}-${ROS_PRETTY_ARCH}-live.zip"

# Start from a clean state
rm -f "${ROOTDIR}/${BOOTCDZIP}"
rm -f "${ROOTDIR}/${LIVECDZIP}"

# Download the "optional" folder from svn.reactos.org
mkdir "${REPODIR}/modules/optional" || exit 1
cd "${REPODIR}/modules/optional" || 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 exist in the "optional" folder.
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

# Build ReactOS
cd "${REPODIR}" || exit 1
./configure.sh -DENABLE_ROSAPPS=1 -DENABLE_WALLPAPERS=1 || exit 1
cd "${REPODIR}/${OUTPUTDIR}" || exit 1
ninja bootcd || exit 1
ninja livecd || exit 1

# Create the 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

# We're done!
echo
echo "*******************************************************************************"
echo "Successfully created the following packages:"
echo
echo " - ${BOOTCDZIP}"
echo " - ${LIVECDZIP}"
echo "*******************************************************************************"
echo
35 changes: 35 additions & 0 deletions Scripts/Release_Source
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# ReactOS Release Engineering Scripts
# Release_Source - Create the "-src.zip" package

# Sanity checks
if ! source ./Release_Config; then
echo "Please run Release_Configure first!"
exit 1
fi

if [ "$ROS_ARCH" = "" ]; then
echo "Please run this script inside RosBE!"
exit 1
fi

# Constants
ROOTDIR="$PWD"
EXPORTDIR="ReactOS-${version}"
SOURCEZIP="ReactOS-${version}-src.zip"

# Start from a clean state
rm -f "${ROOTDIR}/${SOURCEZIP}"

# Create the ZIP package
cd "${REPODIR}"
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
echo " - ${SOURCEZIP}"
echo "*******************************************************************************"
echo
37 changes: 13 additions & 24 deletions Scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

# Constants
ROOTDIR="$PWD"
REPODIR="$PWD/Release_WorkDir/Repo"
OPTMODULESDIR="${REPODIR}/modules/optional"
OUTPUTDIR="output-MinGW-i386"
OPTMODULESDIR="${ROOTDIR}/modules/optional"
OUTPUTDIR="${ROOTDIR}/output-MinGW-i386"

echo "*******************************************************************************"
echo "* ReactOS Release Script *"
Expand All @@ -18,7 +17,7 @@ if [ "$ROS_ARCH" = "" ]; then
fi

# Ensure this is running inside a git directory.
if [ ! -d "${REPODIR}/.git" ]; then
if [ ! -d "${ROOTDIR}/.git" ]; then
echo "Please run this script inside a ReactOS git directory. Release aborted."
exit 1
fi
Expand Down Expand Up @@ -53,16 +52,14 @@ if [ "$version" = "" ] || [ "$branch_name" = "" ]; then
exit 1
fi

# Ensure git is in a good state.
echo "Cleaning git repository..."
cd "${REPODIR}" || exit 1
# Clean repository, excluding the modules/optional folder and its contents.
git clean -d -f -f -x --exclude="/modules/optional/*" || exit 1
git remote set-url origin https://github.com/reactos/reactos.git || exit 1
# Fetch changes from origin if we have an internet connection.
if [ "$internet" ]; then
git fetch origin || exit 1
fi
git checkout "${branch_name}" || exit 1
git reset --hard "origin/${branch_name}" || exit 1
# 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.
Expand Down Expand Up @@ -101,14 +98,10 @@ LIVECDZIP="ReactOS-${version}-${ROS_ARCH}-live.zip"
EXPORTDIR="ReactOS-${version}"
SOURCEZIP="ReactOS-${version}-src.zip"

# Checks passed! Delete any reminant BootCD and LiveCD deliverables.
rm -f "${ROOTDIR}/${BOOTCDZIP}"
rm -f "${ROOTDIR}/${LIVECDZIP}"

# Build ReactOS
cd "${REPODIR}" || exit 1
cd "${ROOTDIR}" || exit 1
./configure.sh -DENABLE_ROSAPPS=1 -DENABLE_WALLPAPERS=1 || exit 1
cd "${REPODIR}/${OUTPUTDIR}" || exit 1
cd "${OUTPUTDIR}" || exit 1
ninja bootcd || exit 1
ninja livecd || exit 1

Expand All @@ -119,20 +112,16 @@ zip -9 "${ROOTDIR}/${BOOTCDZIP}" "${BOOTCDISO}" || exit 1
mv "livecd.iso" "${LIVECDISO}" || exit 1
zip -9 "${ROOTDIR}/${LIVECDZIP}" "${LIVECDISO}" || exit 1

# Delete any reminant source deliverable
rm -f "${ROOTDIR}/${SOURCEZIP}"

# Create the ZIP package for the source deliverable
echo "Creating source ZIP package..."
cd "${REPODIR}"
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
echo " - ${BOOTCDZIP}"
echo " - ${LIVECDZIP}"
echo " - ${SOURCEZIP}"
echo " ${ROOTDIR}/${BOOTCDZIP}"
echo " ${ROOTDIR}/${LIVECDZIP}"
echo " ${ROOTDIR}/${SOURCEZIP}"
echo "*******************************************************************************"