forked from NagyD/SDLPoP
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
149 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: [ xbox ] | ||
push: | ||
branches: [ xbox ] | ||
|
||
jobs: | ||
#BUILD LINUX | ||
Linux: | ||
env: | ||
FILENAME_LINUX: 0 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install and Setup Dependencies | ||
run: | | ||
sudo apt update -y | ||
sudo apt install libsdl2-dev libsdl2-image-dev | ||
#Create output filename | ||
export FILENAME_LINUX=SDLPoPX_Linux_$(date -u +'%Y%m%d%H%M') | ||
echo "::set-env name=FILENAME_LINUX::$FILENAME_LINUX" | ||
- name: Compile | ||
run: | | ||
cd src/ | ||
cmake . | ||
make | ||
# Only create artifact on a push to master | ||
- if: github.event_name == 'push' | ||
name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.FILENAME_LINUX }} | ||
path: | | ||
data | ||
doc | ||
mods | ||
prince | ||
SDLPoP.ini | ||
#BUILD WIN32 | ||
Windows: | ||
env: | ||
FILENAME_WIN32: 0 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install and Setup Dependencies | ||
run: | | ||
sudo apt update -y | ||
sudo apt install mingw-w64 | ||
# Symlink windres | ||
sudo ln -s /usr/bin/i686-w64-mingw32-windres /usr/bin/windres | ||
# Setup SDL2 and SDL2_Image | ||
cd ~ | ||
wget https://libsdl.org/release/SDL2-devel-2.0.12-mingw.tar.gz | ||
wget https://libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-mingw.tar.gz | ||
tar xzf SDL2-devel-2.0.12-mingw.tar.gz | ||
tar xzf SDL2_image-devel-2.0.5-mingw.tar.gz | ||
sudo cp -r SDL2-2.0.12/i686-w64-mingw32/* /usr/i686-w64-mingw32/ | ||
sudo cp -r SDL2_image-2.0.5/i686-w64-mingw32/* /usr/i686-w64-mingw32/ | ||
#Create output filename | ||
export FILENAME_WIN32=SDLPoPX_Windows_$(date -u +'%Y%m%d%H%M') | ||
echo "::set-env name=FILENAME_WIN32::$FILENAME_WIN32" | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name : Compile | ||
run: | | ||
cd src/ | ||
cmake -DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows \ | ||
-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc \ | ||
-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ . | ||
make | ||
- name : Collate Output Files | ||
run: | | ||
cp ~/SDL2-2.0.12/i686-w64-mingw32/bin/SDL2.dll SDL2.dll | ||
cp ~/SDL2_image-2.0.5/i686-w64-mingw32/bin/SDL2_image.dll SDL2_image.dll | ||
cp ~/SDL2_image-2.0.5/i686-w64-mingw32/bin/zlib1.dll zlib1.dll | ||
cp ~/SDL2_image-2.0.5/i686-w64-mingw32/bin/libpng16-16.dll libpng16-16.dll | ||
# Only create artifact on a push to master | ||
- if: github.event_name == 'push' | ||
name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.FILENAME_WIN32 }} | ||
path: | | ||
data | ||
doc | ||
mods | ||
prince.exe | ||
SDLPoP.ini | ||
SDL2.dll | ||
SDL2_image.dll | ||
zlib1.dll | ||
libpng16-16.dll | ||
#BUILD XBOX | ||
Xbox: | ||
env: | ||
FILENAME_XBOX: 0 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install and Setup Dependencies | ||
run: | | ||
sudo apt-get update -y && sudo apt-get install -y flex bison clang lld | ||
git clone https://github.com/XboxDev/nxdk.git --recursive | ||
#Create output filename | ||
export FILENAME_XBOX=SDLPoPX_Xbox_$(date -u +'%Y%m%d%H%M') | ||
echo "::set-env name=FILENAME_XBOX::$FILENAME_XBOX" | ||
- name: Compile | ||
run: | | ||
export PATH=$PATH:/usr/lib/llvm-6.0/bin | ||
make -f Makefile.nxdk -j$(nproc) NXDK_DIR=$(pwd)/nxdk | ||
# Only create artifact on a push to master | ||
- if: github.event_name == 'push' | ||
name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ env.FILENAME_XBOX }} | ||
path: | | ||
doc | ||
bin/data | ||
bin/default.xbe | ||
bin/LICENSE.txt | ||
PrinceofPersia.iso |