2019-07-17 20:50:38 +02:00
|
|
|
#!/bin/sh
|
2019-07-21 07:30:19 +02:00
|
|
|
printf "\n\n--------------------------------------- BUILD -----------------------------------------------\n";
|
2019-07-17 20:50:38 +02:00
|
|
|
|
2019-07-21 07:30:19 +02:00
|
|
|
# Setup Script Variables
|
2019-07-17 20:50:38 +02:00
|
|
|
SOURCE_FOLDER=$1;
|
|
|
|
OUTPUT_TARBALL=$2;
|
2019-07-21 07:30:19 +02:00
|
|
|
_SOURCE_CODE_BINARY_TARBALL_LOCATION="./obj*/dist/librewolf*.tar.bz2";
|
2019-07-17 20:50:38 +02:00
|
|
|
|
2019-07-17 22:22:03 +02:00
|
|
|
# Prevents build from breaking in CI/CD environments
|
|
|
|
export SHELL=/bin/bash;
|
|
|
|
|
2019-07-21 07:30:19 +02:00
|
|
|
# Changes current folder to the source code folder
|
|
|
|
cd $SOURCE_FOLDER;
|
2019-07-17 20:50:38 +02:00
|
|
|
|
2019-07-21 07:30:19 +02:00
|
|
|
# Runs bootstrapper to install dependencies
|
2019-07-17 21:02:01 +02:00
|
|
|
printf "\nRunning bootstrapper to install build dependencies (using ./mach script within source code)\n";
|
|
|
|
./mach bootstrap --application-choice=browser --no-interactive;
|
2019-07-17 20:50:38 +02:00
|
|
|
|
2019-07-21 07:30:19 +02:00
|
|
|
# Executes the actual build
|
2019-07-17 20:50:38 +02:00
|
|
|
printf "\nBuilding LibreWolf\n";
|
|
|
|
./mach build;
|
|
|
|
|
2019-07-21 07:30:19 +02:00
|
|
|
# Packages the build into a binary tarball
|
2019-07-17 20:50:38 +02:00
|
|
|
printf "\nPackaging LibreWolf\n";
|
|
|
|
./mach package;
|
|
|
|
|
2019-07-21 07:30:19 +02:00
|
|
|
# Moves the packaged tarball to the specified location
|
2019-07-17 20:50:38 +02:00
|
|
|
printf "\nMoving Binary Tarball to output location\n";
|
2019-07-21 07:30:19 +02:00
|
|
|
mv $_SOURCE_CODE_BINARY_TARBALL_LOCATION $OUTPUT_TARBALL;
|
2019-07-17 20:50:38 +02:00
|
|
|
|
2019-07-21 07:30:19 +02:00
|
|
|
# Deletes the source code
|
|
|
|
printf "\nDeleting source code\n";
|
2019-07-20 00:26:38 +02:00
|
|
|
rm -rf $SOURCE_FOLDER;
|
2019-07-17 20:50:38 +02:00
|
|
|
|