mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-05-10 19:41:39 +00:00
CI config
This commit is contained in:
parent
7d912c88a7
commit
73a7366307
1 changed files with 72 additions and 382 deletions
|
|
@ -2,296 +2,14 @@
|
||||||
# See: https://circleci.com/docs/2.0/configuration-reference
|
# See: https://circleci.com/docs/2.0/configuration-reference
|
||||||
version: 2.1
|
version: 2.1
|
||||||
orbs:
|
orbs:
|
||||||
win: circleci/windows@4.1.1 # The Windows orb give you everything you need to start using the Windows executor.
|
android: circleci/android@2.3.0 # The Windows orb give you everything you need to start using the Windows executor.
|
||||||
|
|
||||||
# Define a job to be invoked later in a workflow.
|
# Define a job to be invoked later in a workflow.
|
||||||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
macos:
|
|
||||||
xcode: 14.1.0 # Specify the Xcode version to use
|
|
||||||
environment:
|
|
||||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
||||||
NPROC: 4
|
|
||||||
COMMIT_TAG: pipeline.git.tag
|
|
||||||
steps:
|
|
||||||
- add_ssh_keys:
|
|
||||||
fingerprints:
|
|
||||||
- "82:42:56:a0:57:43:95:4e:00:c0:8c:c1:7f:70:74:47"
|
|
||||||
- checkout:
|
|
||||||
path: ~/MBHaxe
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Install brew dependencies
|
|
||||||
command: |
|
|
||||||
brew install cmake
|
|
||||||
brew install pkg-config
|
|
||||||
brew install libpthread-stubs
|
|
||||||
brew install neko
|
|
||||||
brew install nasm
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Install Haxe
|
|
||||||
command: |
|
|
||||||
set -eux
|
|
||||||
download_url="https://github.com/HaxeFoundation/haxe/releases/download/4.3.1/haxe-4.3.1-osx.tar.gz"
|
|
||||||
echo "Downloading [$download_url]..."
|
|
||||||
mkdir /tmp/haxe
|
|
||||||
curl -fsSL --retry 3 --retry-delay 5 "$download_url" -o /tmp/haxe.tar.gz
|
|
||||||
tar xzvf /tmp/haxe.tar.gz -C /tmp/haxe --strip-components=1
|
|
||||||
export PATH=/tmp/haxe/:"$PATH"
|
|
||||||
export HAXE_STD_PATH=/tmp/haxe/std
|
|
||||||
haxelib setup ~/haxelib
|
|
||||||
haxelib list
|
|
||||||
haxelib install hashlink
|
|
||||||
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile zlib
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
curl https://www.zlib.net/zlib-1.2.13.tar.xz | tar xz
|
|
||||||
cd zlib-1.2.13
|
|
||||||
if [ ! -f /usr/local/lib/libz.1.2.13.dylib ]; then
|
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build --config Release -j$NPROC
|
|
||||||
sudo cmake --install build
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile alsoft
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
curl https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2 | tar xz
|
|
||||||
cd openal-soft-1.22.2
|
|
||||||
if [ ! -f /usr/local/lib/libopenal.1.22.2.dylib ]; then
|
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DALSOFT_BACKEND_SNDIO=NO -DALSOFT_BACKEND_PORTAUDIO=NO -DALSOFT_BACKEND_WAVE=NO -DALSOFT_UTILS=NO -DALSOFT_EXAMPLES=NO -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build --config Release -j$NPROC
|
|
||||||
sudo cmake --install build
|
|
||||||
fi
|
|
||||||
- run:
|
|
||||||
name: Compile jpeg-turbo (x86)
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
curl -L https://downloads.sourceforge.net/project/libjpeg-turbo/2.1.4/libjpeg-turbo-2.1.4.tar.gz | tar xz
|
|
||||||
cd libjpeg-turbo-2.1.4
|
|
||||||
if [ ! -f /usr/local/lib/libturbojpeg.0.2.0.dylib ]; then
|
|
||||||
cmake -S. -Bbuild-x86 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DCMAKE_MACOSX_RPATH=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local
|
|
||||||
cmake --build build-x86 --config release -j$NPROC
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile jpeg-turbo (ARM64)
|
|
||||||
command: |
|
|
||||||
cd ~/deps/libjpeg-turbo-2.1.4
|
|
||||||
if [ ! -f /usr/local/lib/libturbojpeg.0.2.0.dylib ]; then
|
|
||||||
cmake -S. -Bbuild-arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DCMAKE_MACOSX_RPATH=TRUE -DCMAKE_INSTALL_PREFIX=/usr/local
|
|
||||||
cmake --build build-arm64 --config release -j$NPROC
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Install jpeg-turbo (Universal)
|
|
||||||
command: |
|
|
||||||
if [ ! -f /usr/local/lib/libturbojpeg.0.2.0.dylib ]; then
|
|
||||||
cd ~/deps/libjpeg-turbo-2.1.4/build-arm64
|
|
||||||
for i in libjpeg.62.3.0.dylib cjpeg cjpeg-static djpeg djpeg-static jcstest jpegtran jpegtran-static libjpeg.a libturbojpeg.a libturbojpeg.0.2.0.dylib rdjpgcom strtest tjbench tjbench-static tjexample tjunittest tjunittest-static wrjpgcom
|
|
||||||
do
|
|
||||||
lipo -create -output $i ../build-x86/$i $i
|
|
||||||
done
|
|
||||||
sudo cmake --install .
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile libogg
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
curl -L https://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.xz | tar xz
|
|
||||||
cd libogg-1.3.5
|
|
||||||
if [ ! -f /usr/local/lib/libogg.0.8.5.dylib ]; then
|
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build --config Release -j$NPROC
|
|
||||||
sudo cmake --install build
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile libvorbis
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
curl -L https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz | tar xz
|
|
||||||
cd libvorbis-1.3.7
|
|
||||||
if [ ! -f /usr/local/lib/libvorbis.0.4.9.dylib ]; then
|
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build --config Release -j$NPROC
|
|
||||||
sudo cmake --install build
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile libpng (x86)
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
curl -L https://download.sourceforge.net/libpng/libpng-1.6.39.tar.xz | tar xz
|
|
||||||
cd libpng-1.6.39
|
|
||||||
if [ ! -f /usr/local/lib/libpng16.16.dylib ]; then
|
|
||||||
cmake -S. -Bbuild-x86 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build-x86 --config release -j$NPROC
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile libpng (arm64)
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
cd libpng-1.6.39
|
|
||||||
if [ ! -f /usr/local/lib/libpng16.16.dylib ]; then
|
|
||||||
cmake -S. -Bbuild-arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build-arm64 --config release -j$NPROC
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Install libpng (Universal)
|
|
||||||
command: |
|
|
||||||
if [ ! -f /usr/local/lib/libpng16.16.dylib ]; then
|
|
||||||
cd ~/deps/libpng-1.6.39/build-arm64
|
|
||||||
for i in libpng16.16.39.0.dylib libpng16.a png-fix-itxt pngfix pngimage pngstest pngtest pngunknown pngvalid
|
|
||||||
do
|
|
||||||
lipo -create -output $i ../build-x86/$i $i
|
|
||||||
done
|
|
||||||
sudo cmake --install .
|
|
||||||
fi
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile SDL2
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
curl -L https://github.com/libsdl-org/SDL/releases/download/release-2.26.1/SDL2-2.26.1.tar.gz | tar xz
|
|
||||||
cd SDL2-2.26.1
|
|
||||||
if [ ! -f /usr/local/lib/libSDL2-2.0.0.dylib ]; then
|
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build --config Release -j$NPROC
|
|
||||||
sudo cmake --install build
|
|
||||||
fi
|
|
||||||
- run:
|
|
||||||
name: Compile libuv
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
curl https://dist.libuv.org/dist/v1.44.2/libuv-v1.44.2.tar.gz | tar xz
|
|
||||||
cd libuv-v1.44.2
|
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build --config Release -j$NPROC
|
|
||||||
sudo cmake --install build
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Install hashlink
|
|
||||||
command: |
|
|
||||||
mkdir -p ~/deps
|
|
||||||
cd ~/deps
|
|
||||||
git clone --depth=1 https://github.com/RandomityGuy/hashlink
|
|
||||||
cd hashlink
|
|
||||||
# Fix OpenAL
|
|
||||||
# curl -L https://github.com/nullobsi/hashlink/commit/a09491918cc4b83c2cb9fcded855fe967857385f.diff | git apply
|
|
||||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.15" -DCMAKE_FIND_FRAMEWORK=LAST -DWITH_SQLITE=OFF -DBUILD_TESTING=OFF -DCMAKE_MACOSX_RPATH=TRUE
|
|
||||||
cmake --build build --config Release -j$NPROC
|
|
||||||
sudo cmake --install build
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Install haxe dependencies
|
|
||||||
command: |
|
|
||||||
export PATH=/tmp/haxe/:"$PATH"
|
|
||||||
export HAXE_STD_PATH=/tmp/haxe/std
|
|
||||||
haxelib git heaps https://github.com/RandomityGuy/heaps
|
|
||||||
haxelib dev hlopenal ~/deps/hashlink/libs/openal
|
|
||||||
haxelib dev hlsdl ~/deps/hashlink/libs/sdl
|
|
||||||
|
|
||||||
- save_cache:
|
|
||||||
key: mbhaxe-deps-v1
|
|
||||||
paths:
|
|
||||||
- /usr/local/lib/ui.hdll
|
|
||||||
- /usr/local/lib/openal.hdll
|
|
||||||
- /usr/local/lib/fmt.hdll
|
|
||||||
- /usr/local/lib/sdl.hdll
|
|
||||||
- /usr/local/lib/libSDL2-2.0.0.dylib
|
|
||||||
- /usr/local/lib/libhl.1.13.0.dylib
|
|
||||||
- /usr/local/lib/libogg.0.8.5.dylib
|
|
||||||
- /usr/local/lib/libopenal.1.22.2.dylib
|
|
||||||
- /usr/local/lib/libpng16.16.dylib
|
|
||||||
- /usr/local/lib/libturbojpeg.0.2.0.dylib
|
|
||||||
- /usr/local/lib/libvorbis.0.4.9.dylib
|
|
||||||
- /usr/local/lib/libvorbisfile.3.3.8.dylib
|
|
||||||
- /usr/local/lib/libvorbisenc.2.0.12.dylib
|
|
||||||
- /usr/local/lib/libz.1.2.13.dylib
|
|
||||||
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Compile MBHaxe
|
|
||||||
command: |
|
|
||||||
export PATH=/tmp/haxe/:"$PATH"
|
|
||||||
export HAXE_STD_PATH=/tmp/haxe/std
|
|
||||||
cd ~/MBHaxe
|
|
||||||
haxe compile-macos.hxml
|
|
||||||
cd native
|
|
||||||
cp ~/deps/hashlink/src/hlc_main.c .
|
|
||||||
clang -mmacosx-version-min=10.15 -arch x86_64 -arch arm64 -o marblegame -I . -L /usr/local/lib/ -std=c11 marblegame.c /usr/local/lib/{ui.hdll,openal.hdll,fmt.hdll,sdl.hdll,uv.hdll,ssl.hdll} -lsdl2 -lhl
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Package app bundle
|
|
||||||
command: |
|
|
||||||
cd ~/MBHaxe
|
|
||||||
./package-macos.sh v$COMMIT_TAG
|
|
||||||
cd "macos-dist/MarbleBlast Ultra.app/Contents/MacOS"
|
|
||||||
otool -L marblegame
|
|
||||||
cd ../Frameworks
|
|
||||||
cp /usr/local/lib/{ui.hdll,openal.hdll,fmt.hdll,sdl.hdll,libSDL2-2.0.0.dylib,ssl.hdll,uv.hdll} .
|
|
||||||
cp /usr/local/lib/libhl.1.13.0.dylib libhl.1.dylib
|
|
||||||
cp /usr/local/lib/libogg.0.8.5.dylib libogg.0.dylib
|
|
||||||
cp /usr/local/lib/libopenal.1.22.2.dylib libopenal.1.dylib
|
|
||||||
cp /usr/local/lib/libpng16.16.dylib libpng16.16.dylib
|
|
||||||
cp /usr/local/lib/libturbojpeg.0.2.0.dylib libturbojpeg.0.dylib
|
|
||||||
cp /usr/local/lib/libvorbis.0.4.9.dylib libvorbis.0.4.9.dylib
|
|
||||||
cp /usr/local/lib/libvorbisfile.3.3.8.dylib libvorbisfile.3.3.8.dylib
|
|
||||||
cp /usr/local/lib/libvorbisenc.2.0.12.dylib libvorbisenc.2.0.12.dylib
|
|
||||||
cp /usr/local/lib/libz.1.2.13.dylib libz.1.dylib
|
|
||||||
cp /usr/local/lib/libuv.1.dylib libuv.1.dylib
|
|
||||||
# These libraries have dangling RPATHs
|
|
||||||
install_name_tool -delete_rpath /usr/local/lib libturbojpeg.0.dylib
|
|
||||||
for i in fmt.hdll libpng16.16.dylib
|
|
||||||
do
|
|
||||||
install_name_tool -change /usr/lib/libz.1.dylib @rpath/libz.1.dylib $i
|
|
||||||
done
|
|
||||||
- run:
|
|
||||||
name: Sign app bundle
|
|
||||||
command: |
|
|
||||||
cd ~/MBHaxe/macos-dist
|
|
||||||
xattr -rc "MarbleBlast Ultra.app"
|
|
||||||
cp "MarbleBlast Ultra.app/Contents/Entitlements.plist" .
|
|
||||||
codesign --deep --entitlements Entitlements.plist -fs - "MarbleBlast Ultra.app"
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: ZIP Bundle
|
|
||||||
command: |
|
|
||||||
cd ~/MBHaxe
|
|
||||||
rm -rf "macos-dist/MarbleBlast Ultra.app.in"
|
|
||||||
zip -r MBHaxe-Ultra-Mac.zip macos-dist/
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: Upload to Artifact Storage
|
|
||||||
command: |
|
|
||||||
scp -o StrictHostKeyChecking=no -i $KEYPATH -P $PORT ~/MBHaxe/MBHaxe-Ultra-Mac.zip $REMOTEDIR/MBHaxe-Ultra-Mac.zip
|
|
||||||
|
|
||||||
# - store_artifacts:
|
|
||||||
# path: ~/MBHaxe/MBHaxe-Platinum-Mac.zip
|
|
||||||
|
|
||||||
build-win:
|
|
||||||
executor:
|
executor:
|
||||||
name: win/server-2022
|
name: android/android-machine
|
||||||
shell: bash.exe # executor type
|
tag: 2021.10.1
|
||||||
# Checkout the code as the first step. This is a dedicated CircleCI step.
|
# Checkout the code as the first step. This is a dedicated CircleCI step.
|
||||||
# The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default.
|
# The python orb's install-packages step will install the dependencies from a Pipfile via Pipenv by default.
|
||||||
# Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt.
|
# Here we're making sure we use just use the system-wide pip. By default it uses the project root's requirements.txt.
|
||||||
|
|
@ -301,133 +19,105 @@ jobs:
|
||||||
- add_ssh_keys:
|
- add_ssh_keys:
|
||||||
fingerprints:
|
fingerprints:
|
||||||
- "82:42:56:a0:57:43:95:4e:00:c0:8c:c1:7f:70:74:47"
|
- "82:42:56:a0:57:43:95:4e:00:c0:8c:c1:7f:70:74:47"
|
||||||
- checkout
|
|
||||||
|
- checkout:
|
||||||
|
path: ~/MBHaxe
|
||||||
|
- run:
|
||||||
|
name: Decode Android key store
|
||||||
|
command: echo $BASE64_KEYSTORE | base64 -d | tee keystore ~/MBHaxe/keystore > /dev/null
|
||||||
- run:
|
- run:
|
||||||
name: Install dependencies
|
name: Install dependencies
|
||||||
command: |
|
command: |
|
||||||
curl -fsSL --retry 3 --retry-delay 5 -o /tmp/sdl.zip https://www.libsdl.org/release/SDL2-devel-2.0.5-VC.zip
|
set -eux
|
||||||
curl -fsSL --retry 3 --retry-delay 5 -o /tmp/openal.zip https://openal-soft.org/openal-binaries/openal-soft-1.17.2-bin.zip
|
download_url="https://github.com/HaxeFoundation/haxe/releases/download/4.3.3/haxe-4.3.3-linux64.tar.gz"
|
||||||
curl -fsSL --retry 3 --retry-delay 5 -o /tmp/ffmpeg.zip https://github.com/HaxeFoundation/hashlink/files/5648056/ffmpeg-3.4.2-win64-dev.zip
|
|
||||||
cd /tmp
|
|
||||||
7z x /tmp/sdl.zip -oinclude; mv /tmp/include/SDL2* /tmp/include/sdl
|
|
||||||
7z x /tmp/openal.zip -oinclude; mv /tmp/include/openal* /tmp/include/openal
|
|
||||||
7z x /tmp/ffmpeg.zip -oinclude; mv /tmp/include/ffmpeg* /tmp/include/ffmpeg
|
|
||||||
- run:
|
|
||||||
name: Install Neko
|
|
||||||
command: |
|
|
||||||
choco install --no-progress neko -y
|
|
||||||
nekopath=$(/bin/find /c/ProgramData/chocolatey/lib/neko -name neko.dll -printf '%h\n')
|
|
||||||
set NEKOPATH=$nekopath
|
|
||||||
export PATH=$nekopath:"$PATH"
|
|
||||||
- run:
|
|
||||||
name: Install Haxe
|
|
||||||
command: |
|
|
||||||
download_url="https://github.com/HaxeFoundation/haxe/releases/download/4.3.1/haxe-4.3.1-win64.zip"
|
|
||||||
echo "Downloading [$download_url]..."
|
echo "Downloading [$download_url]..."
|
||||||
mkdir /tmp/haxe
|
mkdir /tmp/haxe
|
||||||
curl -fsSL --retry 3 --retry-delay 5 "$download_url" -o /tmp/haxe.zip
|
curl -fsSL --retry 3 --retry-delay 5 "$download_url" -o /tmp/haxe.tar.gz
|
||||||
7z x /tmp/haxe.zip -o/tmp
|
tar xzvf /tmp/haxe.tar.gz -C /tmp/haxe --strip-components=1
|
||||||
mv -v /tmp/haxe_* /tmp/haxe
|
sudo apt-get update
|
||||||
cd /tmp/haxe
|
sudo apt install neko
|
||||||
mv haxe_* haxe
|
export PATH=/tmp/haxe/:"$PATH"
|
||||||
export PATH=/tmp/haxe/haxe:"$PATH"
|
export HAXE_STD_PATH=/tmp/haxe/std
|
||||||
export HAXE_STD_PATH=/tmp/haxe/haxe/std
|
|
||||||
nekopath=$(/bin/find /c/ProgramData/chocolatey/lib/neko -name neko.dll -printf '%h\n')
|
|
||||||
set NEKOPATH=$nekopath
|
|
||||||
export PATH=$nekopath:"$PATH"
|
|
||||||
haxelib setup ~/haxelib
|
haxelib setup ~/haxelib
|
||||||
haxelib list
|
haxelib list
|
||||||
- run:
|
- run:
|
||||||
name: Build Hashlink
|
name: Install Android NDK
|
||||||
command: |
|
command: |-
|
||||||
mkdir ~/deps
|
#!/bin/bash
|
||||||
cd ~/deps
|
echo y | sdkmanager "ndk;18.1.5063045"
|
||||||
git clone https://github.com/RandomityGuy/hashlink
|
android_ndk_home=""
|
||||||
cd hashlink
|
if [[ -d "${HOME}/android-sdk/ndk/18.1.5063045" ]]; then
|
||||||
mv /tmp/include/sdl include/sdl
|
android_ndk_home="$HOME/android-sdk/ndk/18.1.5063045"
|
||||||
mv /tmp/include/openal include/openal
|
elif [[ -d "/opt/android/sdk/ndk/18.1.5063045" ]]; then
|
||||||
MSBuild.exe hl.sln -m -nologo -p:Configuration=Release -p:Platform=x64
|
android_ndk_home="/opt/android/sdk/ndk/18.1.5063045"
|
||||||
|
else
|
||||||
|
echo "Android NDK did not install successfully"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "export ANDROID_NDK_HOME=$android_ndk_home" >> "$BASH_ENV"
|
||||||
|
echo "Android NDK was installed at \"$android_ndk_home\"."
|
||||||
|
echo y | sdkmanager "platforms;android-31"
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install haxe dependencies
|
name: Install haxe dependencies
|
||||||
command: |
|
command: |
|
||||||
export PATH=/tmp/haxe/haxe:"$PATH"
|
export PATH=/tmp/haxe/:"$PATH"
|
||||||
export HAXE_STD_PATH=/tmp/haxe/haxe/std
|
export HAXE_STD_PATH=/tmp/haxe/std
|
||||||
nekopath=$(/bin/find /c/ProgramData/chocolatey/lib/neko -name neko.dll -printf '%h\n')
|
mkdir ~/deps
|
||||||
set NEKOPATH=$nekopath
|
cd ~/deps
|
||||||
export PATH=$nekopath:"$PATH"
|
git clone https://github.com/RandomityGuy/hashlink
|
||||||
haxelib git heaps https://github.com/RandomityGuy/heaps
|
haxelib git heaps https://github.com/RandomityGuy/heaps
|
||||||
haxelib dev hlopenal ~/deps/hashlink/libs/openal
|
haxelib dev hlopenal ~/deps/hashlink/libs/openal
|
||||||
haxelib dev hlsdl ~/deps/hashlink/libs/sdl
|
haxelib dev hlsdl ~/deps/hashlink/libs/sdl
|
||||||
haxelib dev hashlink ~/deps/hashlink/other/haxelib
|
haxelib dev hashlink ~/deps/hashlink/other/haxelib
|
||||||
|
haxelib git zyheaps https://github.com/rainyt/zyheaps
|
||||||
|
- run:
|
||||||
|
name: Prepare directories
|
||||||
|
command: |
|
||||||
|
cd ~/deps
|
||||||
|
git clone https://github.com/RandomityGuy/MBHaxeAndroidLibs
|
||||||
|
cd ~/MBHaxe/Export/android
|
||||||
|
cp -R ~/deps/MBHaxeAndroidLibs/* app/
|
||||||
|
cd ~/deps/MBHaxeAndroidLibs/src/main/cpp/openal-soft
|
||||||
|
mv CMakeLists.txt CMakeLists-copy.txt
|
||||||
|
mv 'CMakeLists 2.txt' CMakeLists.txt
|
||||||
|
cmake .
|
||||||
|
cmake --build .
|
||||||
|
cp -pf ~/deps/MBHaxeAndroidLibs/src/main/cpp/openal-soft/native-tools/bsincgen ~/MBHaxe/Export/android/app/src/main/cpp/openal-nativetools
|
||||||
|
cp -pf ~/deps/MBHaxeAndroidLibs/src/main/cpp/openal-soft/native-tools/bin2h ~/MBHaxe/Export/android/app/src/main/cpp/openal-nativetools
|
||||||
- run:
|
- run:
|
||||||
name: Compile MBHaxe
|
name: Compile MBHaxe
|
||||||
command: |
|
command: |
|
||||||
export PATH=/tmp/haxe/haxe:"$PATH"
|
export PATH=/tmp/haxe/:"$PATH"
|
||||||
export HAXE_STD_PATH=/tmp/haxe/haxe/std
|
cd ~/MBHaxe
|
||||||
nekopath=$(/bin/find /c/ProgramData/chocolatey/lib/neko -name neko.dll -printf '%h\n')
|
haxe Export/android/app/src/main/build.hxml
|
||||||
set NEKOPATH=$nekopath
|
mkdir -p Export/android/app/src/main/assets/data
|
||||||
export PATH=$nekopath:"$PATH"
|
cp -rf data/* Export/android/app/src/main/assets/data
|
||||||
cd ~/project
|
cd Export/android
|
||||||
haxe compile-c.hxml
|
chmod +x gradlew
|
||||||
cd native
|
./gradlew
|
||||||
sed -i -e 's/MaxSpeed/Disabled/g' marblegame.vcxproj
|
cp -pf ~/deps/MBHaxeAndroidLibs/src/main/cpp/openal-soft/CMakeLists-copy.txt ~/deps/MBHaxeAndroidLibs/src/main/cpp/openal-soft/CMakeLists.txt
|
||||||
sed -i -e 's/<FunctionLevelLinking>true<\/FunctionLevelLinking>//g' marblegame.vcxproj
|
./gradlew assembleRelease
|
||||||
sed -i -e 's/<IntrinsicFunctions>true<\/IntrinsicFunctions>//g' marblegame.vcxproj
|
|
||||||
sed -i -e 's/<EnableCOMDATFolding>true<\/EnableCOMDATFolding>//g' marblegame.vcxproj
|
|
||||||
sed -i -e 's/<OptimizeReferences>true<\/OptimizeReferences>//g' marblegame.vcxproj
|
|
||||||
sed -i -e 's/HL_MAKE;//g' marblegame.vcxproj
|
|
||||||
sed -i -e 's/<ClInclude Include=".*" \/>//g' marblegame.vcxproj
|
|
||||||
sed -i -e 's/<ClCompile Include=".*" \/>//g' marblegame.vcxproj
|
|
||||||
perl -0777 -i.marblegame.vcxproj -pe 's/<ItemGroup>[^.]*<\/ItemGroup>/<ItemGroup><ClCompile Include="marblegame.c" \/><\/ItemGroup>/g' marblegame.vcxproj
|
|
||||||
HASHLINKPATH=~/deps/hashlink
|
|
||||||
MSBuild.exe marblegame.sln -m -nologo -p:Configuration=Release -p:Platform=x64 -p:PlatformToolset=v142 -p:HASHLINK=$HASHLINKPATH
|
|
||||||
- run:
|
- run:
|
||||||
name: Package app bundle
|
name: Sign APK
|
||||||
command: |
|
command: |
|
||||||
cd ~/project
|
cd ~/MBHaxe
|
||||||
mkdir release
|
sudo apt install apksigner
|
||||||
cd release
|
echo $RELEASE_STORE_PASSWORD | apksigner sign --ks ~/MBHaxe/keystore Export/android/app/build/outputs/apk/release/app-release-unsigned.apk
|
||||||
cp ../native/x64/Release/marblegame.exe .
|
|
||||||
mv marblegame.exe marbleblast.exe
|
|
||||||
cp -r ../data .
|
|
||||||
cp ~/deps/hashlink/x64/Release/libhl.dll .
|
|
||||||
cp ~/deps/hashlink/x64/Release/fmt.hdll .
|
|
||||||
cp ~/deps/hashlink/x64/Release/ui.hdll .
|
|
||||||
cp ~/deps/hashlink/x64/Release/openal.hdll .
|
|
||||||
cp ~/deps/hashlink/x64/Release/sdl.hdll .
|
|
||||||
cp ~/deps/hashlink/x64/Release/ssl.hdll .
|
|
||||||
cp ~/deps/hashlink/x64/Release/uv.hdll .
|
|
||||||
cp ~/deps/hashlink/include/sdl/lib/x64/SDL2.dll .
|
|
||||||
cp ~/deps/hashlink/include/openal/bin/Win64/soft_oal.dll ./OpenAL32.dll
|
|
||||||
- run:
|
|
||||||
name: Zip bundle
|
|
||||||
command: |
|
|
||||||
cd ~/project
|
|
||||||
7z a MBHaxe-Ultra-Win.zip release/
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Upload to Artifact Storage
|
name: Upload to Artifact Storage
|
||||||
command: |
|
command: |
|
||||||
scp -o StrictHostKeyChecking=no -i $KEYPATH -P $PORT ~/project/MBHaxe-Ultra-Win.zip $REMOTEDIR/MBHaxe-Ultra-Win.zip
|
scp -o StrictHostKeyChecking=no -i $KEYPATH -P $PORT ~/MBHaxe/Export/android/app/build/outputs/apk/release/app-release-unsigned.apk $REMOTEDIR/MBHaxe-Ultra.apk
|
||||||
# - store_artifacts:
|
|
||||||
# path: ~/project/MBHaxe-Platinum-Win.zip
|
|
||||||
|
|
||||||
|
|
||||||
# Invoke jobs via workflows
|
# Invoke jobs via workflows
|
||||||
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
||||||
workflows:
|
workflows:
|
||||||
build-mac:
|
build-android:
|
||||||
jobs:
|
jobs:
|
||||||
- build:
|
- build:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /^\d+.\d+.\d+$/
|
only: /^\d+.\d+.\d+$/
|
||||||
|
|
||||||
build-windows:
|
|
||||||
jobs:
|
|
||||||
- build-win:
|
|
||||||
filters:
|
|
||||||
tags:
|
|
||||||
only: /^\d+.\d+.\d+$/
|
|
||||||
Loading…
Add table
Reference in a new issue