This commit is contained in:
Kirill Zhumarin 2024-06-30 21:35:12 +00:00
parent 7c2c0bb895
commit 4d2880e4d6
5 changed files with 70 additions and 0 deletions

34
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Build
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Installing dependencies
run: |
sudo apt-get update
sudo apt-get -y install cmake mingw-w64 mingw-w64-tools mingw-w64-i686-dev mingw-w64-x86-64-dev mingw-w64-common fakeroot build-essential
- name: Building emulator
run: |
tools/build_deb.sh
tools/build_win.sh
- uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
files:
- ../*.deb
- build-win/ptr89.exe

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
build
build-win
.cache
*.vkp
*.ini

View file

@ -0,0 +1,13 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
SET(CMAKE_AR x86_64-w64-mingw32-ar)
SET(CMAKE_RANLIB x86_64-w64-mingw32-ranlib)
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

9
tools/build_deb.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/bash
set -e
set -x
cd $(dirname $0)/../
fakeroot debian/rules binary
fakeroot debian/rules clean
ls -lah ../*.deb

13
tools/build_win.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
set -e
set -x
cd $(dirname $0)/../
[[ -d ./build-win ]] && rm -rf ./build-win
mkdir build-win
cd build-win
cmake .. -DCMAKE_TOOLCHAIN_FILE=cmake/Toolchain-x86_64-w64-mingw32.cmake
make -j$(nproc)
ls -lah ptr89.exe