Skip to content
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
2 changes: 0 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# make the default target the lib target
[alias]
b = "post build"
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
[target.aarch64-unknown-linux-gnu]
Expand Down
42 changes: 15 additions & 27 deletions .github/actions/build-plugin/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@ inputs:
required: true
default: ''
description: Rust target platform.
extra_flags:
required: false
default: ''
description: Rust extra flags.
features:
required: false
default: ''
description: simd-nightly,simd-stable,parallel,enhanced-determinism

runs:
using: composite
steps:
- uses: extractions/setup-just@v3
- name: Update Rust
shell: sh
run: |
Expand All @@ -26,33 +19,28 @@ runs:
shell: sh
run: |
rustc --print=target-list
- name: Rust Add target
- name: Add additional arm64 target for macOS
shell: sh
if: ${{ inputs.arch == 'x86_64-apple-darwin'}}
run: |
rustup target add ${{ inputs.arch }}
#--features="${{ inputs.features }}" --no-default-features
- name: Build
rustup target add aarch64-apple-darwin
- name: Rust add current target
shell: sh
run: |
cargo build --target=${{ inputs.arch }} --release ${{ inputs.extra_flags}}
- name: Copy to release
rustup target add ${{ inputs.arch }}
- name: Build for Windows and Linux
shell: sh
if: ${{ inputs.arch != 'x86_64-apple-darwin'}}
run: |
mkdir -p target/release
rm -rf target/release
cp -rf target/${{ inputs.arch }}/release target/release
- name: Build Rapier Macos Universal
just build-patchwork release ${{ inputs.arch }}
- name: Build for Mac
shell: sh
# we already built for x86_64-apple-darwin for mac, now build arm64
if: ${{ inputs.arch == 'x86_64-apple-darwin'}}
run: |
mkdir -p target/release
rustup target add aarch64-apple-darwin
cargo build --target=aarch64-apple-darwin --release
lipo -create -output target/release/libpatchwork_rust_core.dylib target/aarch64-apple-darwin/release/libpatchwork_rust_core.dylib target/x86_64-apple-darwin/release/libpatchwork_rust_core.dylib
- name: Move Static Libs macOS
just build-patchwork release "all-apple-darwin"
- name: Copy to release
shell: sh
if: ${{ inputs.arch == 'x86_64-apple-darwin'}}
run: |
mv target/x86_64-apple-darwin/release/libpatchwork_rust_core.a target/release/libpatchwork_rust_core.x86_64.a
mv target/aarch64-apple-darwin/release/libpatchwork_rust_core.a target/release/libpatchwork_rust_core.arm64.a
mkdir -p target/release
rm -rf target/release
cp -rf target/${{ inputs.arch }}/release target/release
157 changes: 33 additions & 124 deletions .github/workflows/all_editor_builds.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
name: Build Editor All Platforms
name: 🤖 Build Godot for All Platforms
on:
workflow_call:

# Global Settings
# SCONS_CACHE for windows must be set in the build environment
env:
GODOT_REPOSITORY: godotengine/godot
GODOT_BASE_BRANCH: master
# Change Developers.md too
GODOT_MAIN_SYNC_REF: bb92a4c8e27e30cdec05ab6d540d724b9b3cfb72
SCONSFLAGS: verbose=yes warnings=all werror=no module_text_server_fb_enabled=yes minizip=yes deprecated=yes module_patchwork_editor_enabled=yes
SCONSFLAGS_TEMPLATE: no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no
SCONS_CACHE_MSVC_CONFIG: true

concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}
cancel-in-progress: true

jobs:
build:
# Windows 10 with latest image
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- name: "Windows Editor"
- name: "🪟 Build Godot for Windows"
os: "windows-latest"
id: windows-editor
platform: windows
target: editor
sconsflags: tests=yes debug_symbols=yes
bin: ./bin/godot.windows.editor.x86_64.exe

- name: "🐧 Linux Editor"
- name: "🐧 Build Godot for Linux"
os: "ubuntu-22.04"
id: linux-editor
platform: linux
Expand All @@ -43,7 +36,7 @@ jobs:
sconsflags-template: optimize=size use_lto=yes debug_symbols=no
bin: ./bin/godot.linuxbsd.editor.x86_64

- name: "🍎 macOS Editor"
- name: "🍎 Build Godot for macOS"
os: "macos-14"
id: macos-editor
platform: macos
Expand All @@ -52,22 +45,38 @@ jobs:
bin: ./bin/godot.macos.editor.arm64

steps:
- name: checkout-godot
# Checkout patchwork to tmp/
- name: Checkout patchwork-godot-plugin
uses: actions/checkout@v4
with:
repository: ${{env.GODOT_REPOSITORY}}
ref: ${{env.GODOT_MAIN_SYNC_REF}}
fetch-depth: 0
path: tmp/patchwork-tmp

# We must move patchwork to a higher directory than our CWD,
# because if we don't, cloning godot will overwrite patchwork.
# (And Godot's actions expect Godot to be our CWD.)
- name: Move to higher directory
shell: sh
run: mv tmp/patchwork-tmp ../patchwork-tmp

- name: checkout-patchwork_editor
# Grab the environment variables from build.env and output them
- name: Fetch env variables
id: dotenv
uses: falti/[email protected]
with:
path: ../patchwork-tmp/build.env
keys-case: bypass

- name: Checkout Godot
uses: actions/checkout@v4
with:
path: modules/patchwork_editor
fetch-depth: 0
repository: ${{ steps.dotenv.outputs.GODOT_REPO }}
ref: ${{ steps.dotenv.outputs.GODOT_REF }}

- name: copy actions
- name: Copy editor directory
shell: bash
run: |
cp -R modules/patchwork_editor/.github/actions/* .github/actions/
cp -R ../patchwork-tmp/editor modules/patchwork_editor

- name: Select Xcode 16
if: matrix.platform == 'macos'
Expand Down Expand Up @@ -138,7 +147,7 @@ jobs:
- name: Prepare artifact
# Stripping the debug symbols screws up lipo'd binaries on macos, so don't do it
if: matrix.platform != 'macos'
uses: ./.github/actions/godot-prepare-artifact
uses: ./../patchwork-tmp/.github/actions/godot-prepare-artifact

- name: Save Godot build cache
# if: success() || (steps.restore-cache.outputs.cache-hit == 'false' && (steps.compile-editor.outcome != 'skipped' || steps.compile-template.outcome != 'skipped'))
Expand All @@ -152,11 +161,11 @@ jobs:
if: matrix.platform == 'macos' && matrix.target == 'editor'
shell: bash
run: |
chmod +x ${{ github.workspace }}/bin/godot_macos_editor.app/Contents/MacOS/Godot
chmod +x bin/godot_macos_editor.app/Contents/MacOS/Godot

- name: Mac Sign
if: matrix.platform == 'macos' && matrix.target == 'editor'
uses: ./.github/actions/macos-sign
uses: ./../patchwork-tmp/.github/actions/macos-sign
with:
FRAMEWORK_PATH: ${{ github.workspace }}/bin/godot_macos_editor.app
SIGN_FLAGS: "--deep --force --options=runtime --entitlements ${{ github.workspace }}/misc/dist/macos/editor.entitlements"
Expand All @@ -171,106 +180,6 @@ jobs:
- uses: actions/upload-artifact@v4
if: matrix.id != 'linux-sanitizers'
with:
name: patchwork_editor-${{ matrix.platform }}
path: ${{github.workspace}}/bin/*
name: godot-with-patchwork-${{ matrix.platform }}
path: ${{ github.workspace }}/bin/*
retention-days: 90

# test:
# needs: build
# runs-on: ${{ matrix.os }}
# name: ${{ matrix.name }} test
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: "Windows"
# os: "windows-latest"
# platform: windows
# bin: ./bin/godot.windows.editor.x86_64.exe

# - name: "🐧 Linux"
# os: "ubuntu-24.04"
# platform: linux
# bin: ./bin/godot.linuxbsd.editor.x86_64

# - name: "🍎 macOS"
# os: "macos-14"
# platform: macos
# bin: ./bin/godot.macos.editor.arm64

# steps:
# - name: checkout-godot
# uses: actions/checkout@v4
# with:
# repository: GODOT_REPOSITORY
# ref: ${{env.GODOT_MAIN_SYNC_REF}}

# - name: checkout-patchwork_editor
# uses: actions/checkout@v4
# with:
# path: modules/patchwork_editor
# fetch-depth: 0

# - name: copy actions
# shell: bash
# run: |
# cp -R modules/patchwork_editor/.github/actions/* .github/actions/

# - name: Download patchwork_editor artifacts
# uses: actions/download-artifact@v4
# with:
# name: patchwork_editor-editor-${{ matrix.platform }}
# path: bin

# - name: set permissions
# shell: bash
# run: |
# chmod a+x bin/godot*

# - name: run tests
# shell: bash
# run: |
# ${{matrix.bin}} --headless --test --force-colors "--test-case=[patchwork_editor]*"

release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: "ubuntu-latest"
permissions:
contents: write
needs: [build]
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: patchwork_editor-linux
path: artifacts/linux
- name: Download MacOS artifact
uses: actions/download-artifact@v4
with:
name: patchwork_editor-macos
path: artifacts/macos
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: patchwork_editor-windows
path: artifacts/windows
- name: Zip artifacts
run: |
ls -la artifacts/*
cd artifacts/windows
zip -r9 "../patchwork_editor-${{ github.ref_name }}-windows.zip" *
cd ../..
cd artifacts/macos
chmod a+x godot_macos_editor.app/Contents/MacOS/Godot
zip -r9 "../patchwork_editor-${{ github.ref_name }}-macos.zip" *
cd ../..
cd artifacts/linux
chmod a+x *
zip -r9 "../patchwork_editor-${{ github.ref_name }}-linux.zip" *
- name: Release
uses: nikitalita/[email protected]
with:
files: |
artifacts/patchwork_editor-${{ github.ref_name }}-windows.zip
artifacts/patchwork_editor-${{ github.ref_name }}-macos.zip
artifacts/patchwork_editor-${{ github.ref_name }}-linux.zip
63 changes: 63 additions & 0 deletions .github/workflows/compose_projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 🧵 Compose Projects
on:
workflow_call:

jobs:
# Grab the environment variables from build.env and output them
load-env:
name: 🔍 Load Environment variables
runs-on: "ubuntu-latest"
outputs:
THREADBARE_REPO: ${{ steps.dotenv.outputs.THREADBARE_REPO }}
THREADBARE_REF: ${{ steps.dotenv.outputs.THREADBARE_REF }}
MODDABLE_PLATFORMER_REPO: ${{ steps.dotenv.outputs.MODDABLE_PLATFORMER_REPO }}
MODDABLE_PLATFORMER_REF: ${{ steps.dotenv.outputs.MODDABLE_PLATFORMER_REF }}
steps:
- uses: actions/checkout@v4
- id: dotenv
uses: falti/[email protected]
with:
path: build.env
keys-case: bypass

compose-projects:
needs: [load-env]
runs-on: "ubuntu-latest"
name: 🪡 Compose ${{ matrix.project.name }}
strategy:
fail-fast: false
matrix:
project:
- name: threadbare
repo: ${{ needs.load-env.outputs.THREADBARE_REPO }}
ref: ${{ needs.load-env.outputs.THREADBARE_REF }}
- name: moddable-platformer
repo: ${{ needs.load-env.outputs.MODDABLE_PLATFORMER_REPO }}
ref: ${{ needs.load-env.outputs.MODDABLE_PLATFORMER_REF }}
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
repository: ${{ matrix.project.repo }}
ref: ${{ matrix.project.ref }}
path: ${{ matrix.project.name }}
fetch-depth: 0
persist-credentials: false
- name: Download Patchwork
uses: actions/download-artifact@v7
with:
pattern: patchwork-godot-plugin
path: patchwork-godot-plugin
- name: Copy to addons
shell: sh
run: |
mkdir -p ${{ matrix.project.name }}/addons/patchwork
cp -r patchwork-godot-plugin/* ${{ matrix.project.name }}/addons/patchwork
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project.name }}-with-patchwork
path: |
${{ matrix.project.name }}
if-no-files-found: error

Loading