Skip to content

Commit 5c04ea5

Browse files
committed
Add arm builds, x86_32, android, package script
1 parent c178906 commit 5c04ea5

8 files changed

Lines changed: 282 additions & 105 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: C/C++ CI
1+
name: C/C++ CI Tests
22

33
on: [push, pull_request]
44

@@ -9,59 +9,6 @@ env:
99
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
1010

1111
jobs:
12-
linux-x64:
13-
runs-on: ubuntu-24.04
14-
env:
15-
BUILDROOT: x86_64-godot-linux-gnu_sdk-buildroot
16-
steps:
17-
- uses: actions/checkout@v6
18-
with:
19-
submodules: recursive
20-
- name: Restore Godot build cache
21-
uses: ./godot-cpp/.github/actions/godot-cache-restore
22-
with:
23-
cache-name: linux-x86_64
24-
scons-cache: ${{ env.SCONS_CACHE }}
25-
continue-on-error: true
26-
- name: Setup Linux buildroot toolchain cache
27-
uses: actions/cache@v5
28-
with:
29-
path: |
30-
${{ env.BUILDROOT }}.tar.bz2
31-
key: linux-${{ env.BUILDROOT }}-buildroot
32-
continue-on-error: true
33-
- name: Setup Linux toolchains
34-
run: |
35-
if [ ! -f ${{ env.BUILDROOT }}.tar.bz2 ]; then
36-
wget https://github.com/godotengine/buildroot/releases/download/godot-2026.05.x-1/${{ env.BUILDROOT }}.tar.bz2
37-
fi
38-
tar -xjf ${{ env.BUILDROOT }}.tar.bz2
39-
${{ env.BUILDROOT }}/relocate-sdk.sh
40-
rm ${{ env.BUILDROOT }}/bin/cmake
41-
echo "$GITHUB_WORKSPACE/${{ env.BUILDROOT }}/bin" >> $GITHUB_PATH
42-
echo "PKG_CONFIG=$GITHUB_WORKSPACE/${{ env.BUILDROOT }}/share/pkgconfig/" >> $GITHUB_ENV
43-
- name: Build for Linux editor x86_64
44-
run: |
45-
pip3 install scons
46-
scons platform=linux arch=x86_64
47-
ldd addons/godot-git-plugin/linux/*.so
48-
- name: Save Godot build cache
49-
uses: ./godot-cpp/.github/actions/godot-cache-save
50-
with:
51-
cache-name: linux-x86_64
52-
scons-cache: ${{ env.SCONS_CACHE }}
53-
continue-on-error: true
54-
- name: Prepare artifact
55-
run: |
56-
mkdir out
57-
mv addons out/
58-
- uses: actions/upload-artifact@v7
59-
with:
60-
name: libgit_plugin.linux.x86_64.editor.so-${{ github.sha }}
61-
if-no-files-found: error
62-
path: |
63-
out/
64-
6512
windows-x64:
6613
runs-on: windows-2022
6714
steps:
@@ -92,7 +39,7 @@ jobs:
9239
shell: bash
9340
run: |
9441
# Not needed to use the plugin.
95-
rm -f addons/godot-git-plugin/windows/*.{exp,lib}
42+
rm -f addons/godot-git-plugin/lib/*.{exp,lib}
9643
mkdir out
9744
mv addons out/
9845
- uses: actions/upload-artifact@v7
@@ -101,37 +48,3 @@ jobs:
10148
if-no-files-found: error
10249
path: |
10350
out/
104-
105-
macos-universal:
106-
runs-on: macos-latest
107-
steps:
108-
- uses: actions/checkout@v6
109-
with:
110-
submodules: recursive
111-
- name: Restore Godot build cache
112-
uses: ./godot-cpp/.github/actions/godot-cache-restore
113-
with:
114-
cache-name: macos-universal
115-
scons-cache: ${{ env.SCONS_CACHE }}
116-
continue-on-error: true
117-
- name: Build for macOS editor universal
118-
run: |
119-
pip install scons
120-
scons platform=macos arch=universal macos_deployment_target=10.13
121-
otool -L addons/godot-git-plugin/macos/*.dylib
122-
- name: Save Godot build cache
123-
uses: ./godot-cpp/.github/actions/godot-cache-save
124-
with:
125-
cache-name: macos-universal
126-
scons-cache: ${{ env.SCONS_CACHE }}
127-
continue-on-error: true
128-
- name: Prepare artifact
129-
run: |
130-
mkdir out
131-
mv addons out/
132-
- uses: actions/upload-artifact@v7
133-
with:
134-
name: libgit_plugin.macos.universal.editor.dylib-${{ github.sha }}
135-
if-no-files-found: error
136-
path: |
137-
out/
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
name: 🔧 Build -> Package 📦
2+
on: [push, pull_request]
3+
4+
env:
5+
# Only used for the cache key. Increment version to force clean build.
6+
GODOT_BASE_BRANCH: master
7+
# LLVM version
8+
MINGW_LLVM_VERSION: "20260616"
9+
# Hardcoding this seem to be the only way
10+
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/28.1.13356709/
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ matrix.os }}
15+
name: 🔧 Build
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
# Android
21+
- platform: android
22+
arch: 'x86_64'
23+
sconsflags: ''
24+
os: 'ubuntu-24.04'
25+
cache-name: android-x86_64
26+
- platform: android
27+
arch: 'arm64'
28+
sconsflags: ''
29+
os: 'ubuntu-24.04'
30+
cache-name: android-arm64
31+
32+
# Linux
33+
- platform: linux
34+
arch: 'x86_32'
35+
buildroot: 'i686-godot-linux-gnu_sdk-buildroot'
36+
sconsflags: ''
37+
os: 'ubuntu-24.04'
38+
cache-name: linux-x86_32
39+
- platform: linux
40+
arch: 'x86_64'
41+
buildroot: 'x86_64-godot-linux-gnu_sdk-buildroot'
42+
sconsflags: ''
43+
os: 'ubuntu-24.04'
44+
cache-name: linux-x86_64
45+
- platform: linux
46+
arch: 'arm32'
47+
buildroot: 'arm-godot-linux-gnueabihf_sdk-buildroot'
48+
sconsflags: ''
49+
os: 'ubuntu-24.04'
50+
cache-name: linux-arm32
51+
- platform: linux
52+
arch: 'arm64'
53+
buildroot: 'aarch64-godot-linux-gnu_sdk-buildroot'
54+
sconsflags: ''
55+
os: 'ubuntu-24.04'
56+
cache-name: linux-arm64
57+
58+
# macOS
59+
- platform: macos
60+
arch: 'universal'
61+
sconsflags: ''
62+
os: 'macos-latest'
63+
cache-name: macos-universal
64+
65+
# Windows
66+
- platform: windows
67+
arch: 'x86_32'
68+
sconsflags: 'use_mingw=yes'
69+
os: 'ubuntu-24.04'
70+
cache-name: win-x86_32
71+
- platform: windows
72+
arch: 'x86_64'
73+
sconsflags: 'use_mingw=yes'
74+
os: 'ubuntu-24.04'
75+
cache-name: win-x86_64
76+
- platform: windows
77+
arch: 'arm64'
78+
sconsflags: 'use_mingw=yes use_llvm=yes'
79+
os: 'ubuntu-24.04'
80+
cache-name: win-arm64
81+
82+
env:
83+
SCONS_CACHE: ${{ github.workspace }}/.scons-cache/
84+
SCONSFLAGS: ${{ matrix.sconsflags }} platform=${{ matrix.platform }} arch=${{ matrix.arch }} build_profile=build_profile.json target=editor api_version=4.3 target_path=out/addons/godot-git-plugin/ --jobs=2
85+
86+
defaults:
87+
run:
88+
shell: bash
89+
90+
steps:
91+
- uses: actions/checkout@v6
92+
with:
93+
submodules: recursive
94+
95+
- name: Restore Godot build cache
96+
uses: ./godot-cpp/.github/actions/godot-cache-restore
97+
with:
98+
cache-name: ${{ matrix.cache-name }}
99+
scons-cache: ${{ env.SCONS_CACHE }}
100+
continue-on-error: true
101+
102+
- name: Setup Windows MinGW toolchain cache
103+
if: ${{ matrix.platform == 'windows' && matrix.arch == 'arm64' }}
104+
uses: actions/cache@v5
105+
with:
106+
path: |
107+
llvm-mingw-$MINGW_LLVM_VERSION-ucrt-ubuntu-22.04-x86_64.tar.bz2
108+
key: llvm-mingw-$MINGW_LLVM_VERSION-ucrt-ubuntu-22.04-x86_64
109+
110+
- name: Install mingw-LLVM
111+
if: ${{ matrix.platform == 'windows' && matrix.arch == 'arm64' }}
112+
run: |
113+
NAME=llvm-mingw-$MINGW_LLVM_VERSION-ucrt-ubuntu-22.04-x86_64
114+
URL="https://github.com/mstorsjo/llvm-mingw/releases/download/$MINGW_LLVM_VERSION/$NAME.tar.xz"
115+
if [ ! -f $NAME.bz2 ]; then
116+
wget $URL
117+
fi
118+
tar -xJf $NAME.tar.xz
119+
echo "$GITHUB_WORKSPACE/$NAME/bin" >> $GITHUB_PATH
120+
121+
- name: Install mingw-GCC
122+
if: ${{ matrix.platform == 'windows' && matrix.arch != 'arm64' }}
123+
run: |
124+
sudo apt-get update
125+
sudo apt-get install build-essential mingw-w64
126+
sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
127+
sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
128+
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
129+
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
130+
dpkg -l | grep ii | grep mingw
131+
update-alternatives --get-selections | grep mingw
132+
133+
- name: Install Linux build dependencies
134+
if: ${{ matrix.platform == 'linux' }}
135+
run: |
136+
sudo apt-get update
137+
sudo apt-get install build-essential gcc-multilib g++-multilib wget
138+
139+
- name: Setup Linux buildroot toolchain cache
140+
if: ${{ matrix.platform == 'linux' }}
141+
uses: actions/cache@v5
142+
with:
143+
path: |
144+
${{ matrix.buildroot }}.tar.bz2
145+
key: linux-${{ matrix.buildroot }}-buildroot
146+
147+
- name: Set up Python 3.x
148+
uses: actions/setup-python@v6
149+
with:
150+
python-version: '3.x'
151+
architecture: 'x64'
152+
153+
- name: Configuring Python packages
154+
run: |
155+
python -c "import sys; print(sys.version)"
156+
python -m pip install scons
157+
158+
- name: Setup Linux toolchains
159+
if: ${{ matrix.platform == 'linux' }}
160+
run: |
161+
if [ ! -f ${{ matrix.buildroot }}.tar.bz2 ]; then
162+
wget https://github.com/godotengine/buildroot/releases/download/godot-2026.05.x-1/${{ matrix.buildroot }}.tar.bz2
163+
fi
164+
tar -xjf ${{ matrix.buildroot }}.tar.bz2
165+
${{ matrix.buildroot }}/relocate-sdk.sh
166+
rm ${{ matrix.buildroot }}/bin/cmake
167+
echo "$GITHUB_WORKSPACE/${{ matrix.buildroot }}/bin" >> $GITHUB_PATH
168+
echo "PKG_CONFIG=$GITHUB_WORKSPACE/${{ matrix.buildroot }}/share/pkgconfig/" >> $GITHUB_ENV
169+
170+
- name: Setup Android dependencies
171+
if: ${{ matrix.platform == 'android' }}
172+
uses: nttld/setup-ndk@v1
173+
with:
174+
ndk-version: r28b
175+
link-to-sdk: true
176+
177+
- name: Print tools versions
178+
run: |
179+
python --version
180+
scons --version
181+
cmake --version
182+
183+
- name: Compile Extension (4.3+) - ${{ matrix.platform }} - ${{ matrix.arch }}
184+
run: |
185+
scons
186+
187+
- name: Save Godot build cache
188+
uses: ./godot-cpp/.github/actions/godot-cache-save
189+
with:
190+
cache-name: ${{ matrix.cache-name }}
191+
scons-cache: ${{ env.SCONS_CACHE }}
192+
continue-on-error: true
193+
194+
- uses: actions/upload-artifact@v7
195+
with:
196+
name: ${{ github.job }}-${{ matrix.platform }}-${{ matrix.arch }}
197+
path: |
198+
out/
199+
200+
package:
201+
name: 📦 Package
202+
needs: build
203+
runs-on: "ubuntu-latest"
204+
steps:
205+
- uses: actions/checkout@v6
206+
with:
207+
submodules: recursive
208+
209+
- uses: actions/download-artifact@v8
210+
with:
211+
path: artifacts
212+
213+
- name: Bundle licenses.
214+
run: |
215+
cp LICENSE artifacts/LICENSE.godot-git-plugin
216+
cp thirdparty/mbedtls/LICENSE artifacts/LICENSE.mbedtls
217+
cp thirdparty/ssh2/libssh2/COPYING artifacts/LICENSE.libssh2
218+
cp thirdparty/git2/libgit2/COPYING artifacts/LICENSE.libgit2
219+
220+
- name: Package artifacts for release
221+
env:
222+
DESTINATION: "release"
223+
run: |
224+
mkdir release
225+
./misc/scripts/package_release.sh
226+
ls -R release
227+
228+
- uses: actions/upload-artifact@v7
229+
with:
230+
name: godot-git-plugin
231+
path: release/godot-git-plugin.zip

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ extension_api.json
1919

2020
# Binaries
2121
__pycache__/
22-
build/
23-
bin/
24-
macos/
25-
linux/
26-
windows/
2722
*.lib
2823
*.a
2924
*.obj

SConstruct

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ env.Append(CPPPATH=["#thirdparty/git2/libgit2/include/"])
5959
lib_sources = Glob("godot-git-plugin/src/*.cpp")
6060
env.Depends(lib_sources, ssl + ssh2)
6161
library = env.SharedLibrary(
62-
target=env["target_path"] + "/{}/{}{}{}".format(env["platform"], env["target_name"], env["suffix"], env["SHLIBSUFFIX"]),
62+
target=env["target_path"] + "/lib/{}{}{}".format(env["target_name"], env["suffix"], env["SHLIBSUFFIX"]),
6363
source=lib_sources,
6464
)
65+
library += env.InstallAs(env["target_path"] + "/git_plugin.gdextension", env.File("#misc/git_plugin.gdextension"))
6566
Default(library)

addons/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

addons/godot-git-plugin/git_plugin.gdextension

Lines changed: 0 additions & 10 deletions
This file was deleted.

misc/git_plugin.gdextension

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[configuration]
2+
3+
entry_symbol = "git_plugin_init"
4+
compatibility_minimum = "4.3"
5+
6+
[libraries]
7+
8+
android.editor.arm64 = "lib/libgit_plugin.android.editor.arm64.so"
9+
android.editor.x86_64 = "lib/libgit_plugin.android.editor.x86_64.so"
10+
linux.editor.arm64 = "lib/libgit_plugin.linux.editor.arm64.so"
11+
linux.editor.arm32 = "lib/libgit_plugin.linux.editor.arm32.so"
12+
linux.editor.x86_64 = "lib/libgit_plugin.linux.editor.x86_64.so"
13+
linux.editor.x86_32 = "lib/libgit_plugin.linux.editor.x86_32.so"
14+
macos.editor = "lib/libgit_plugin.macos.editor.universal.dylib"
15+
windows.editor.arm64 = "lib/libgit_plugin.windows.editor.arm64.dll"
16+
windows.editor.arm32 = "lib/libgit_plugin.windows.editor.arm32.dll"
17+
windows.editor.x86_64 = "lib/libgit_plugin.windows.editor.x86_64.dll"
18+
windows.editor.x86_32 = "lib/libgit_plugin.windows.editor.x86_32.dll"

0 commit comments

Comments
 (0)