Updated dist to build in specified directory

Avoids any issues from building via mount
This commit is contained in:
raz0red 2020-01-04 14:30:33 -08:00
parent 48c2788266
commit 28816bd98d
2 changed files with 24 additions and 1 deletions

View file

@ -12,7 +12,7 @@ jobs:
with:
submodules: recursive
- run: docker run raz0red/devkitppc /opt/devkitpro/pacman/bin/pacman -Q
- run: docker run -v $(pwd):/source raz0red/devkitppc /source/dist.sh
- run: docker run -v $(pwd):/source raz0red/devkitppc /source/dist.sh /tmp/wii7800
- uses: actions/upload-artifact@v1
with:
name: dist

23
dist.sh
View file

@ -22,6 +22,29 @@ function fail() {
exit 1
}
#
# Build in directory specified (if applicable)
#
if [ ! -z $1 ]; then
BUILD_DIR=$1
echo "Building in: $BUILD_DIR..."
rm -rf $BUILD_DIR \
|| { fail 'Unable to delete build directory.'; }
cp -R $SCRIPTPATH $BUILD_DIR \
|| { fail 'Unable to copy files to build directory.'; }
find $BUILD_DIR -type f \
\( -name "*.o" -or -name "*.a" -or -name "*.dol" -or -name "*.elf" \) \
-exec rm {} + \
|| { fail 'Unable to delete previous build output files.'; }
$BUILD_DIR/dist.sh \
|| { fail 'Error running dist script.'; }
rm -rf $DIST_DIR \
|| { fail 'Unable to remove dist directory.'; }
cp -R $BUILD_DIR/dist $DIST_DIR \
|| { fail 'Unable to copy files to final dist directory.'; }
exit 0
fi
# Build wii-emucommon
echo "Building wii-emucommon..."
$EMUCOMMON_DIR/dist.sh || { fail 'Error building wii-emucommon.'; }