Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update action #3

Merged
merged 9 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 50 additions & 3 deletions .github/workflows/build-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Build Tests
on:
push:
pull_request:
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -12,6 +10,7 @@ jobs:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Build Linux Rebel Editor
Expand All @@ -20,6 +19,54 @@ jobs:
build-options: production=yes target=release_debug
rebel-executable: rebel.x11.opt.tools.64

- name: Build Linux Rebel Engine 32 bit
os: ubuntu-latest
artifact: linux-engine-x86-32
build-options: production=yes tools=no target=release bits=32
rebel-executable: rebel.x11.opt.32

- name: Build Windows Rebel Editor on Linux
os: ubuntu-latest
artifact: windows-editor-mingw-linux
build-options: platform=windows production=yes target=release_debug
rebel-executable: rebel.windows.opt.tools.64.mingw.exe

- name: Build Windows Rebel Editor using MSVC
os: windows-latest
artifact: windows-editor-msvc
build-options: production=yes target=release_debug
rebel-executable: rebel.windows.opt.tools.64.msvc.exe

- name: Build Windows Rebel Editor using MinGW
os: windows-latest
artifact: windows-editor-mingw
build-options: production=yes target=release_debug use_mingw=yes
rebel-executable: rebel.windows.opt.tools.64.mingw.exe

- name: Build macOS Rebel Editor
os: macOS-latest
artifact: macos-editor
build-options: production=yes target=release_debug
rebel-executable: rebel.osx.opt.tools.64

- name: Build Android Rebel Engine Library
os: ubuntu-latest
artifact: android-engine-library-arm64
build-options: platform=android production=yes tools=no target=release
rebel-executable: librebel.android.opt.armv8.so

- name: Build iOS Rebel Engine Library
os: macOS-latest
artifact: ios-engine-library-arm64
build-options: platform=iphone production=yes tools=no target=release
rebel-executable: librebel.iphone.opt.arm64.a

- name: Build Web Rebel Engine
os: ubuntu-latest
artifact: web-engine
build-options: platform=javascript production=yes tools=no target=release
rebel-executable: rebel.javascript.opt.zip

steps:
- name: Checkout Rebel Build Action
uses: actions/checkout@v4
Expand Down
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,25 @@
# RebelBuildAction
Github Action for building Rebel Engine
# Rebel Build Action

Github Action for building Rebel Engine.

This Action provides a standardised way for building Rebel Engine and Rebel Editor. It uses [`actions/upload-artifact@v4`](https://github.com/actions/upload-artifact) to allow the executable or library that is built to be downloaded as an artifact.

## Usage

```
- uses: RebelToolbox/RebelBuildAction@v3
with:
# Name of the artifact to be uploaded
artifact:

# SCons build options
build-options:

# Use a build cache to make subsequent builds faster
# Type: boolean
# Default: true
use-build-cache: true

# Filename of the binary that will be built
rebel-executable:
```
89 changes: 63 additions & 26 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
description: Name of the artifact to be uploaded
build-options:
description: SCons build options
use-build-cache:
description: Use a build cache to make subsequent builds faster
type: boolean
default: true
rebel-executable:
# TODO: Replace with an output.
# This input should not be needed.
Expand All @@ -20,51 +24,84 @@ runs:
repository: RebelToolbox/RebelEngine
path: RebelEngine

- name: Install dependencies
shell: bash
run: |
#Install dependencies
if [[ "${{ runner.os }}" == "Linux" ]]; then
echo "::group::Installing Linux dependencies"
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y \
build-essential \
g++-multilib \
pkg-config \
clang \
lld \
mingw-w64 \
emscripten \
scons \
libx11-dev \
libxcursor-dev \
libxinerama-dev \
libxrandr-dev \
libxi-dev \
libgl-dev \
libudev-dev \
libasound2-dev \
libpulse-dev \
libx11-dev:i386 \
libxcursor-dev:i386 \
libxinerama-dev:i386 \
libxrandr-dev:i386 \
libxi-dev:i386 \
libgl-dev:i386 \
libudev-dev:i386 \
libasound2-dev:i386 \
libpulse-dev:i386 \
yasm
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
echo "::endgroup::"
fi
if [[ "${{ runner.os }}" == "Windows" ]]; then
echo "::group::Installing Windows dependencies"
python -m ensurepip --upgrade
python -m pip install scons
echo "::endgroup::"
fi
if [[ "${{ runner.os }}" == "macOS" ]]; then
echo "::group::Installing macOS dependencies"
brew update
brew install \
scons \
yasm
echo "::endgroup::"
fi

- name: Set SCons Cache Environment Variable
if: inputs.use-build-cache == 'true'
shell: bash
run: echo "SCONS_CACHE=.scons-cache/" >> $GITHUB_ENV

- name: Setup SCons cache
if: inputs.use-build-cache == 'true'
uses: actions/cache@v4
with:
path: RebelEngine/${{ env.SCONS_CACHE }}
key: ${{ github.job }}-${{ strategy.job-index }}-${{ github.sha }}
restore-keys: |
${{ github.job }}-${{ strategy.job-index }}-

- name: Install dependencies
shell: bash
run: |
#Install dependencies
echo "::group::Install dependencies"
sudo apt-get update
sudo apt-get install -y \
build-essential \
pkg-config \
clang \
lld \
python3 \
scons \
libx11-dev \
libxcursor-dev \
libxinerama-dev \
libxrandr-dev \
libxi-dev \
libgl-dev \
libudev-dev \
libasound2-dev \
libpulse-dev \
yasm
echo "::endgroup::"

- name: Build Rebel
shell: bash
working-directory: RebelEngine
run: |
#Build Rebel
echo "::group::Build Rebel"
echo "::group::Building Rebel"
scons -j2 ${{ inputs.build-options }}
echo "::endgroup::"
echo "Build files:"
ls -1 bin

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down