Browse Source

ci: nswitch: attempt to use dkp's docker image

because they banned the ci server from accessing their pacman repo
pull/2/head
fgsfds 2 years ago
parent
commit
72b8246969
  1. 43
      scripts/gha/build_nswitch.sh
  2. 43
      scripts/gha/build_nswitch_docker.sh
  3. 31
      scripts/gha/deps_nswitch.sh

43
scripts/gha/build_nswitch.sh

@ -2,49 +2,18 @@ @@ -2,49 +2,18 @@
. scripts/lib.sh
# args: branch name, gamedir name
build_hlsdk()
{
echo "Building HLSDK: $1 branch..."
git checkout switch-$1
./waf configure -T release --nswitch || die_configure
./waf build || die
cp build/dlls/$1_nswitch_aarch64.so ../../pkgtemp/xash3d/$2/dlls/
cp build/cl_dll/client_nswitch_aarch64.so ../../pkgtemp/xash3d/$2/cl_dlls/
./waf clean
}
export DEVKITPRO=/opt/devkitpro
source $DEVKITPRO/switchvars.sh || die
cd "$BUILDDIR" || die
rm -rf artifacts build pkgtemp hlsdktemp
rm -rf artifacts build pkgtemp
mkdir -p pkgtemp/xash3d/{valve,gearbox,bshift}/{dlls,cl_dlls} || die
mkdir -p artifacts/ || die
echo "Building engine..."
./waf configure -T release --nswitch || die_configure
./waf build || die
echo "Building HLSDK..."
mkdir -p hlsdktemp || die
cd hlsdktemp || die
echo "Running build script in Docker container..."
# TODO: replace with FWGS/hlsdk-portable.git when PRs are merged
git clone --recursive https://github.com/fgsfdsfgs/hlsdk-xash3d.git
cd hlsdk-xash3d || die
build_hlsdk hl valve
build_hlsdk opfor gearbox
build_hlsdk bshift bshift
docker --name xash-build --rm -v `pwd`:`pwd` -w `pwd` devkitpro/devkita64:latest bash ./scripts/gha/build_nswitch_docker.sh || die
echo "Packaging artifacts..."
cp build/engine/xash.nro pkgtemp/xash3d/xash3d.nro
cp build/ref/gl/libref_gl.so pkgtemp/xash3d/
cp build/ref/soft/libref_soft.so pkgtemp/xash3d/
cp build/3rdparty/mainui/libmenu.so pkgtemp/xash3d/
cp build/3rdparty/extras/extras.pk3 pkgtemp/xash3d/valve/
mkdir -p artifacts/ || die
find artifacts
7z a -t7z artifacts/xash3d-fwgs-nswitch.7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -r artifacts/xash3d

43
scripts/gha/build_nswitch_docker.sh

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
#!/bin/bash
. scripts/lib.sh
export DEVKITPRO=/opt/devkitpro
source $DEVKITPRO/switchvars.sh || die
# args: branch name, gamedir name
build_hlsdk()
{
echo "Building HLSDK: $1 branch..."
git checkout switch-$1
./waf configure -T release --nswitch || die_configure
./waf build || die
cp build/dlls/$1_nswitch_aarch64.so ../pkgtemp/xash3d/$2/dlls/
cp build/cl_dll/client_nswitch_aarch64.so ../pkgtemp/xash3d/$2/cl_dlls/
./waf clean
}
echo "Building libsolder..."
sudo make -C libsolder install || exit 1
echo "Building engine..."
./waf configure -T release --nswitch || die_configure
./waf build || die
echo "Building HLSDK..."
# TODO: replace with FWGS/hlsdk-portable.git when PRs are merged
cd hlsdk-xash3d || die
build_hlsdk hl valve
build_hlsdk opfor gearbox
build_hlsdk bshift bshift
echo "Copying artifacts..."
cp build/engine/xash.nro pkgtemp/xash3d/xash3d.nro
cp build/ref/gl/libref_gl.so pkgtemp/xash3d/
cp build/ref/soft/libref_soft.so pkgtemp/xash3d/
cp build/3rdparty/mainui/libmenu.so pkgtemp/xash3d/
cp build/3rdparty/extras/extras.pk3 pkgtemp/xash3d/valve/

31
scripts/gha/deps_nswitch.sh

@ -2,30 +2,17 @@ @@ -2,30 +2,17 @@
cd $GITHUB_WORKSPACE
echo "Downloading and installing dkp-pacman..."
echo "Downloading devkitA64 docker container..."
wget https://apt.devkitpro.org/install-devkitpro-pacman
chmod +x ./install-devkitpro-pacman
sudo ./install-devkitpro-pacman
sudo dkp-pacman --noconfirm -Sy
docker pull devkitpro/devkita64:latest || exit 1
echo "Downloading and installing devkitA64..."
echo "Downloading libsolder..."
export DEVKITPRO=/opt/devkitpro
export DEVKITA64=$DEVKITPRO/devkitA64
export PORTLIBS=$DEVKITPRO/portlibs
rm -rf libsolder
git clone https://github.com/fgsfdsfgs/libsolder.git || exit 1
sudo dkp-pacman --noconfirm -S devkitA64 dkp-toolchain-vars switch-cmake switch-pkg-config
echo "Downloading HLSDK..."
echo "Downloading and installing packaged dependencies..."
sudo dkp-pacman --noconfirm -S libnx switch-mesa switch-libdrm_nouveau switch-sdl2
echo "Downloading and installing libsolder..."
git clone https://github.com/fgsfdsfgs/libsolder.git
pushd ./libsolder
make
sudo make install
popd
# TODO: change to FWGS/hlsdk-portable.git when changes are merged in
rm -rf hlsdk-xash3d hlsdk-portable
git clone --recursive https://github.com/fgsfdsfgs/hlsdk-xash3d.git || exit 1

Loading…
Cancel
Save