Skip to content
Open
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
80 changes: 80 additions & 0 deletions .github/workflows/Build_Plugin_GTA_2_clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Plugin GTA 2 (Clang)

on:
workflow_dispatch:

push:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_II/**"

pull_request:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_II/**"

jobs:
build:
name: Build

# skip on pull request inside forks
if: github.event_name != 'pull_request' || github.repository == 'DK22Pac/plugin-sdk'

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg software-properties-common lsb-release g++-mingw-w64-i686

# Download LLVM installer script
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh

# Install Clang 23
sudo ./llvm.sh 23

- name: Verify Clang
run: |
clang-23 --version
clang++-23 --version

- name: Install premake5
uses: Jarod42/install-premake5@v7

- name: Premake gmake project
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
premake5 gmake --file=tools/premake/premake5.lua

- name: Build SDK
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release CXX=clang++-23 CC=clang-23 AR=ar -C plugin_II -j$(nproc)

- name: Build test plugin
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release_gta2 CXX=clang++-23 CC=clang-23 AR=ar -C examples/Test -j$(nproc)
80 changes: 80 additions & 0 deletions .github/workflows/Build_Plugin_GTA_3_clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Plugin GTA 3 (Clang)

on:
workflow_dispatch:

push:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_III/**"

pull_request:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_III/**"

jobs:
build:
name: Build

# skip on pull request inside forks
if: github.event_name != 'pull_request' || github.repository == 'DK22Pac/plugin-sdk'

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg software-properties-common lsb-release g++-mingw-w64-i686

# Download LLVM installer script
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh

# Install Clang 23
sudo ./llvm.sh 23

- name: Verify Clang
run: |
clang-23 --version
clang++-23 --version

- name: Install premake5
uses: Jarod42/install-premake5@v7

- name: Premake gmake project
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
premake5 gmake --file=tools/premake/premake5.lua

- name: Build SDK
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release CXX=clang++-23 CC=clang-23 AR=ar -C plugin_III -j$(nproc)

- name: Build test plugin
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release_gta3 CXX=clang++-23 CC=clang-23 AR=ar -C examples/Test -j$(nproc)
80 changes: 80 additions & 0 deletions .github/workflows/Build_Plugin_GTA_4_clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Plugin GTA IV (Clang)

on:
workflow_dispatch:

push:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_IV/**"

pull_request:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_IV/**"

jobs:
build:
name: Build

# skip on pull request inside forks
if: github.event_name != 'pull_request' || github.repository == 'DK22Pac/plugin-sdk'

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg software-properties-common lsb-release g++-mingw-w64-i686

# Download LLVM installer script
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh

# Install Clang 23
sudo ./llvm.sh 23

- name: Verify Clang
run: |
clang-23 --version
clang++-23 --version

- name: Install premake5
uses: Jarod42/install-premake5@v7

- name: Premake gmake project
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
premake5 gmake --file=tools/premake/premake5.lua

- name: Build SDK
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release CXX=clang++-23 CC=clang-23 AR=ar -C plugin_IV -j$(nproc)

- name: Build test plugin
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release_gta4 CXX=clang++-23 CC=clang-23 AR=ar -C examples/Test -j$(nproc)
52 changes: 12 additions & 40 deletions .github/workflows/Build_Plugin_GTA_SA_clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,48 +61,20 @@ jobs:
clang-23 --version
clang++-23 --version

- name: Build SDK
run: |
echo "::group::Setup directories"
mkdir -p output/lib
for dir in shared plugin_sa safetyhook; do
find "$dir" -type d -exec mkdir -p "obj/{}" \;
done
echo "::groupEnd::"

FLAGS="-I. -Ishared -Ishared/game -Iplugin_sa -Iplugin_sa/game_sa -Iplugin_sa/game_sa/enums -Iplugin_sa/game_sa/rw -Isafetyhook -DGTASA -DPLUGIN_SGV_10US -DRW"
CLANG_FLAGS="--target=i686-w64-mingw32 -fpermissive -fcommon -fms-extensions -Wno-microsoft-include -Wno-invalid-offsetof -Wno-builtin-macro-redefined -O2 -D__cpp_concepts=202202L"

echo "::group::Compile C++ files"
find shared plugin_sa safetyhook -name '*.cpp' -print0 | \
xargs -0 -P$(nproc) -I{} clang++-23 $CLANG_FLAGS -std=c++2b $FLAGS -c {} -o obj/{}.o
echo "::groupEnd::"
- name: Install premake5
uses: Jarod42/install-premake5@v7

echo "::group::Compile C files"
find safetyhook -name '*.c' -print0 | \
xargs -0 -P$(nproc) -I{} clang-23 $CLANG_FLAGS $FLAGS -c {} -o obj/{}.o
echo "::groupEnd::"
- name: Premake gmake project
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
premake5 gmake --file=tools/premake/premake5.lua

echo "::group::Archive SDK"
find obj -name '*.o' | xargs i686-w64-mingw32-ar rcs output/lib/libplugin.a
echo "::groupEnd::"
- name: Build SDK
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release CXX=clang++-23 CC=clang-23 AR=ar -C plugin_sa -j$(nproc)

- name: Build test plugin
run: |
echo "::group::Build test plugin"

# Setup object directories for the test plugin
find examples/Test -type d -exec mkdir -p "obj/{}" \;
mkdir -p output/examples

TEST_FLAGS="-I. -Ishared -Ishared/game -Iplugin_sa -Iplugin_sa/game_sa -Iplugin_sa/game_sa/enums -Iplugin_sa/game_sa/rw -Isafetyhook -DGTASA -DPLUGIN_SGV_10US -DRW"
TEST_CLANG_FLAGS="--target=i686-w64-mingw32 -fpermissive -fcommon -fms-extensions -Wno-microsoft-include -Wno-invalid-offsetof -Wno-builtin-macro-redefined -O2 -D__cpp_concepts=202202L"

# Compile
find examples/Test -name '*.cpp' -print0 | \
xargs -0 -P$(nproc) -I{} clang++-23 $TEST_CLANG_FLAGS -std=c++2b $TEST_FLAGS -c {} -o obj/{}.o

# Link into ASI
clang++-23 --target=i686-w64-mingw32 -shared -o output/examples/Test.asi $(find obj/examples/Test -name '*.o') -Loutput/lib -lplugin -static-libgcc -static-libstdc++ -Wl,--enable-stdcall-fixup

echo "::groupEnd::"
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release_gta-sa CXX=clang++-23 CC=clang-23 AR=ar -C examples/Test -j$(nproc)
80 changes: 80 additions & 0 deletions .github/workflows/Build_Plugin_GTA_VC_clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Plugin GTA VC (Clang)

on:
workflow_dispatch:

push:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_vc/**"

pull_request:
paths:
- "!**.dll"
- "!**.md"
- "!**.txt"
- "tools/premake/**"
- "hooking/**"
- "injector/**"
- "modutils/**"
- "safetyhook/**"
- "shared/**"
- "plugin_vc/**"

jobs:
build:
name: Build

# skip on pull request inside forks
if: github.event_name != 'pull_request' || github.repository == 'DK22Pac/plugin-sdk'

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: "recursive"

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg software-properties-common lsb-release g++-mingw-w64-i686

# Download LLVM installer script
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh

# Install Clang 23
sudo ./llvm.sh 23

- name: Verify Clang
run: |
clang-23 --version
clang++-23 --version

- name: Install premake5
uses: Jarod42/install-premake5@v7

- name: Premake gmake project
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
premake5 gmake --file=tools/premake/premake5.lua

- name: Build SDK
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release CXX=clang++-23 CC=clang-23 AR=ar -C plugin_vc -j$(nproc)

- name: Build test plugin
run: |
export PLUGIN_SDK_DIR=$GITHUB_WORKSPACE
make config=release_gta-vc CXX=clang++-23 CC=clang-23 AR=ar -C examples/Test -j$(nproc)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ generated/

.metadata
bin/
build64/
tmp/
*.tmp
*.bak
Expand Down
Loading