Build and Release BennuGD2 Packages #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release BennuGD2 Packages | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
env: [linux, linux32] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up environment for ${{ matrix.env }} | |
run: | | |
sudo apt update | |
if [ "${{ matrix.env }}" == "linux32" ]; then | |
sudo dpkg --add-architecture i386 | |
sudo apt update | |
sudo apt install -y gcc-multilib g++-multilib binutils git cmake build-essential zlib1g-dev:i386 libsdl2-dev:i386 libglu1-mesa-dev:i386 libsdl2-image-dev:i386 libsdl2-mixer-dev:i386 libtheora-dev:i386 libogg-dev:i386 libvorbis-dev:i386 | |
else | |
sudo apt install -y binutils git cmake build-essential zlib1g-dev libsdl2-dev libglu1-mesa-dev libsdl2-image-dev libsdl2-mixer-dev libtheora-dev libogg-dev libvorbis-dev | |
fi | |
- name: Update submodules and Build | |
run: | | |
git submodule update --init --recursive | |
cd vendor | |
./build-sdl-gpu.sh ${{ matrix.env }} | |
cd .. | |
./build.sh ${{ matrix.env }} | |
./build.sh packages | |
- name: Upload BennuGD2 artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: BennuGD2-${{ matrix.env }} | |
path: packages/bgd2-*.tgz | |
build-windows: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up environment | |
run: | | |
sudo apt update | |
sudo apt install -y mingw-w64 build-essential cmake autoconf libtool pkg-config rar libz-mingw-w64-dev | |
- name: Build dependencies | |
run: | | |
cd vendor | |
cd SDL2-2.28.4 | |
sed -i 's,/usr/local,/usr,g' Makefile | |
sudo make cross | |
cd .. | |
cd SDL2_mixer-2.6.3 | |
sed -i 's,/usr/local,/usr,g' Makefile | |
sudo make cross | |
cd .. | |
cd SDL2_image-2.6.3 | |
sed -i 's,/usr/local,/usr,g' Makefile | |
sudo make cross | |
cd .. | |
wget https://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz | |
tar -xvzf libogg-1.3.5.tar.gz | |
cd libogg-1.3.5 | |
./configure --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 | |
make && sudo make install | |
cd .. | |
wget https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.gz | |
tar -xvzf libvorbis-1.3.7.tar.gz | |
cd libvorbis-1.3.7 | |
./configure --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 | |
make && sudo make install | |
cd .. | |
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz | |
tar -xvzf libtheora-1.1.1.tar.gz | |
cd libtheora-1.1.1 | |
./configure --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 --disable-shared --disable-examples | |
make && sudo make install | |
cd ../.. | |
- name: Update submodules and Build | |
run: | | |
git submodule update --init --recursive | |
cd vendor | |
./build-sdl-gpu.sh windows | |
cd .. | |
./build.sh windows | |
echo "#### Building package ####" | |
mkdir -p packages 2>/dev/null | |
rm -f packages/* | |
if [[ -d build/x86_64-w64-mingw32/bin ]]; then \ | |
rar a -ep1 packages/bgd2-x86_64-w64-mingw32-$(date +"%Y-%m-%d").rar \ | |
build/x86_64-w64-mingw32/bin/*.exe \ | |
build/x86_64-w64-mingw32/bin/*.dll \ | |
dependencies/x86_64-w64-mingw32/libSDL2_gpu.dll \ | |
/usr/x86_64-w64-mingw32/bin/libogg*.dll \ | |
/usr/x86_64-w64-mingw32/bin/libvorbis*.dll \ | |
/usr/x86_64-w64-mingw32/bin/SDL2.dll \ | |
/usr/x86_64-w64-mingw32/bin/SDL2_image.dll \ | |
/usr/x86_64-w64-mingw32/bin/SDL2_mixer.dll \ | |
$(find /usr/x86_64-w64-mingw32 -name 'zlib1.dll') \ | |
/usr/x86_64-w64-mingw32/lib/libwinpthread-*.dll \ | |
WhatsNew.txt; \ | |
fi | |
- name: Upload BennuGD2 artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: BennuGD2-windows | |
path: packages/bgd2-x86_64-w64-mingw32-*.rar | |
build-windows-32bit: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up environment | |
run: | | |
sudo apt update | |
sudo apt install -y mingw-w64 build-essential cmake autoconf libtool pkg-config rar libz-mingw-w64-dev | |
- name: Build dependencies for 32-bit | |
run: | | |
cd vendor | |
cd SDL2-2.28.4 | |
sed -i 's,/usr/local,/usr,g' Makefile | |
sudo make cross | |
cd .. | |
cd SDL2_mixer-2.6.3 | |
sed -i 's,/usr/local,/usr,g' Makefile | |
sudo make cross | |
cd .. | |
cd SDL2_image-2.6.3 | |
sed -i 's,/usr/local,/usr,g' Makefile | |
sudo make cross | |
cd .. | |
wget https://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz | |
tar -xvzf libogg-1.3.5.tar.gz | |
cd libogg-1.3.5 | |
./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32 | |
make && sudo make install | |
cd .. | |
wget https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.gz | |
tar -xvzf libvorbis-1.3.7.tar.gz | |
cd libvorbis-1.3.7 | |
./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32 | |
make && sudo make install | |
cd .. | |
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz | |
tar -xvzf libtheora-1.1.1.tar.gz | |
cd libtheora-1.1.1 | |
./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32 --disable-shared --disable-examples | |
make && sudo make install | |
cd ../.. | |
- name: Update submodules and Build for 32-bit | |
run: | | |
git submodule update --init --recursive | |
cd vendor | |
./build-sdl-gpu.sh windows32 | |
cd .. | |
./build.sh windows32 | |
echo "#### Building package ####" | |
mkdir -p packages 2>/dev/null | |
rm -f packages/* | |
if [[ -d build/i686-w64-mingw32/bin ]]; then \ | |
rar a -ep1 packages/bgd2-i686-w64-mingw32-$(date +"%Y-%m-%d").rar \ | |
build/i686-w64-mingw32/bin/*.exe \ | |
build/i686-w64-mingw32/bin/*.dll \ | |
dependencies/i686-w64-mingw32/libSDL2_gpu.dll \ | |
dependencies/i686-w64-mingw32/libgcc_s_dw2-1.dll \ | |
/usr/i686-w64-mingw32/bin/libogg*.dll \ | |
/usr/i686-w64-mingw32/bin/libvorbis*.dll \ | |
/usr/i686-w64-mingw32/bin/SDL2.dll \ | |
/usr/i686-w64-mingw32/bin/SDL2_image.dll \ | |
/usr/i686-w64-mingw32/bin/SDL2_mixer.dll \ | |
$(find /usr/i686-w64-mingw32 -name 'zlib1.dll') \ | |
/usr/i686-w64-mingw32/lib/libwinpthread-*.dll \ | |
WhatsNew.txt; \ | |
fi | |
- name: Upload BennuGD2 artifacts for 32-bit | |
uses: actions/upload-artifact@v3 | |
with: | |
name: BennuGD2-windows32 | |
path: packages/bgd2-i686-w64-mingw32-*.rar | |
build-macosx: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up osxcross | |
run: | | |
sudo apt update | |
sudo apt install -y wget git cmake clang pkg-config tar xz-utils gobjc gobjc++ libobjc-9-dev openssl | |
mkdir -p /opt | |
cd /opt | |
git clone https://github.com/tpoechtrager/osxcross.git | |
cd osxcross | |
wget -nc https://github.com/joseluisq/macosx-sdks/releases/download/10.10/MacOSX10.10.sdk.tar.xz | |
mv MacOSX10.10.sdk.tar.xz tarballs/ | |
sudo ./tools/get_dependencies.sh | |
UNATTENDED=yes ./build.sh | |
echo "#### Setup done ####" | |
- name: Install dependencies | |
run: | | |
sudo mkdir -p /opt/osxcross/target/macports/ | |
sudo echo "http://www.mirrorservice.org/sites/packages.macports.org" > /opt/osxcross/target/macports/MIRROR | |
echo "### patch osxcross-macports ###" | |
sudo sed -i '/^verifyFileIntegrity()/,/^}/cverifyFileIntegrity() {\n local file="$1"\n echo "Skipping integrity check for $file. Returning success."\n return 0\n}' /opt/osxcross/target/bin/osxcross-macports | |
sudo UNATTENDED=yes OSX_VERSION_MIN=10.7 PATH=/opt/osxcross/target/bin:$PATH SDKROOT=/opt/osxcross/target/SDK/MacOSX10.10.sdk MACOSX_DEPLOYMENT_TARGET=10.10 /opt/osxcross/target/bin/osxcross-macports -v install libtheora libsdl2 libsdl2_image libsdl2_mixer | |
- name: Update submodules and Build | |
run: | | |
export OSX_VERSION_MIN=10.7 | |
export PATH=/opt/osxcross/target/bin:$PATH | |
export SDKROOT=/opt/osxcross/target/SDK/MacOSX10.10.sdk | |
export MACOSX_DEPLOYMENT_TARGET=10.10 | |
git submodule update --init --recursive | |
cd vendor | |
./build-sdl-gpu.sh macosx | |
cd .. | |
./build.sh macosx | |
./build.sh packages | |
- name: Upload BennuGD2 artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: BennuGD2-macosx | |
path: packages/x86_64-apple-darwin14-*.tgz | |
create-release: | |
needs: [build, build-windows, build-windows-32bit, build-macosx] | |
runs-on: ubuntu-latest | |
if: success() | |
strategy: | |
matrix: | |
platform: | |
- linux | |
- linux32 | |
- windows | |
- windows32 | |
- macosx | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download BennuGD2 Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: BennuGD2-${{ matrix.platform }} | |
path: ./dist/${{ matrix.platform }} | |
- name: Upload BennuGD2 Artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./dist/${{ matrix.platform }}/* | |
tag_name: ${{ github.ref_name }} | |
name: ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |