Skip to content

Commit

Permalink
Add missing builds for platforms (#20)
Browse files Browse the repository at this point in the history
- Fixes #19
- Fixes #18
  • Loading branch information
Ughuuu authored Oct 29, 2023
1 parent 1540ff4 commit ac0cac6
Show file tree
Hide file tree
Showing 16 changed files with 134 additions and 117 deletions.
25 changes: 13 additions & 12 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@ inputs:
required: true
description: Target platform.
rust_target:
required: false
required: true
default: ''
description: Rust target platform.
arch:
default: ''
description: Target architecture.
target:
required: true
description: Build target (editor, template_release, template_debug).
sconsflags:
required: true
description: Extra flags
precision:
required: true
description: single or double
Expand All @@ -34,7 +28,7 @@ runs:
path: |
${{ github.workspace }}/.scons-cache/
${{ github.workspace }}/godot-cpp/.scons-cache/
key: ${{ inputs.platform }}_${{ inputs.arch }}_${{ inputs.target }}_${{ inputs.precision }}_cache
key: ${{ inputs.platform }}_${{ inputs.arch }}_${{ inputs.precision }}_cache
- uses: paulhatch/semantic-version@v5.3.0
id: version
with:
Expand All @@ -59,19 +53,25 @@ runs:
SCONS_CACHE_DIR: .scons-cache
run: |
cd godot-cpp && \
scons target=${{ inputs.target }} platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=yes ${{ inputs.sconsflags }} precision=${{ inputs.precision }}
scons target=template_debug platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=yes precision=${{ inputs.precision }} && \
scons target=template_release platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=yes precision=${{ inputs.precision }}
- name: Build Rapier
shell: sh
run: |
cd src/rapier2d-wrapper && \
cargo build ${{ inputs.rust_target }} --release --features="${{ inputs.features }},${{ inputs.precision }}"
rustup target add ${{ inputs.rust_target }} && \
cargo build --target=${{ inputs.rust_target }} --release --features="${{ inputs.features }},${{ inputs.precision }}" && \
mkdir -p target/release && \
rm -rf target/release && \
cp -rf target/${{ inputs.rust_target }}/release target/release && \
ls -l target/release
- name: Build Rapier Macos Universal
shell: sh

# we already built for x86_64-apple-darwin for mac, now build arm64
if: ${{ inputs.platform == 'macos'}}
run: |
cd src/rapier2d-wrapper && mkdir release && rustup target add aarch64-apple-darwin && \
cd src/rapier2d-wrapper && mkdir -p target/release && rustup target add aarch64-apple-darwin && \
cargo build --target=aarch64-apple-darwin --release --features="${{ inputs.features }},${{ inputs.precision }}" && \
lipo -create -output target/release/librapier2d_wrapper.a target/aarch64-apple-darwin/release/librapier2d_wrapper.a target/x86_64-apple-darwin/release/librapier2d_wrapper.a
- name: Build Physics Server Rapier
Expand All @@ -80,4 +80,5 @@ runs:
SCONS_CACHE: .scons-cache
SCONS_CACHE_DIR: .scons-cache
run: |
scons target=${{ inputs.target }} platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=no ${{ inputs.sconsflags }} precision=${{ inputs.precision }}
scons target=template_debug platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=no precision=${{ inputs.precision }}
scons target=template_release platform=${{ inputs.platform }} arch=${{ inputs.arch }} generate_bindings=no precision=${{ inputs.precision }}
18 changes: 6 additions & 12 deletions .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ name: 🤖 Android Builds
on:
workflow_call:

# Global Settings
env:
SCONSFLAGS: verbose=yes warnings=extra werror=yes

jobs:
android:
runs-on: "ubuntu-20.04"
name: ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
name: ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
strategy:
fail-fast: false
matrix:
target: [template_debug, template_release]
arch: [x86_64] # Todo reenable arm64
arch: [{arch: "x86_64", rust: "x86_64-linux-android"}, {arch: "arm64",rust: "aarch64-linux-android"}]
precision: [single, double]
features: [simd-stable, enhanced-determinism]

Expand All @@ -29,17 +24,16 @@ jobs:
distribution: temurin
java-version: 11

- name: Build ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Build ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/build
with:
sconsflags: ${{ env.SCONSFLAGS }}
arch: ${{ matrix.arch }}
arch: ${{ matrix.arch.arch }}
rust_target: ${{ matrix.arch.rust }}
platform: android
target: ${{ matrix.target }}
precision: ${{ matrix.precision }}
features: ${{ matrix.features }}

- name: Upload ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Upload ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/upload
with:
precision: ${{ matrix.precision }}
Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/ios_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ name: 🍏 iOS Builds
on:
workflow_call:

# Global Settings
env:
SCONSFLAGS: verbose=yes warnings=extra werror=yes

jobs:
ios:
runs-on: "macos-latest"
name: ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
name: ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
strategy:
fail-fast: false
matrix:
target: [template_debug, template_release]
arch: [arm64]
arch: [{arch: "arm64", rust: "aarch64-apple-ios"}]
precision: [single, double]
features: [simd-stable, enhanced-determinism]

Expand All @@ -23,17 +18,30 @@ jobs:
with:
submodules: true
fetch-depth: 0
- name: Build ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Build ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/build
with:
sconsflags: ${{ env.SCONSFLAGS }}
arch: ${{ matrix.arch }}
arch: ${{ matrix.arch.arch }}
rust_target: ${{ matrix.arch.rust }}
platform: ios
target: ${{ matrix.target }}
precision: ${{ matrix.precision }}
features: ${{ matrix.features }}

- name: Upload ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Sign dylib ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
shell: pwsh
env:
APPLE_CERT_BASE64: ${{ secrets.PROD_MACOS_CERTIFICATE }}
APPLE_CERT_PASSWORD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
APPLE_DEV_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
APPLE_DEV_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
APPLE_DEV_PASSWORD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
APPLE_DEV_APP_ID: ${{ secrets.PROD_MACOS_APPLE_DEV_APP_ID }}
run: |
./scripts/ci-sign-macos.ps1 bin/addons/godot-rapier2d/bin/libphysics_server_rapier2d.ios.template_debug.dylib
./scripts/ci-sign-macos.ps1 bin/addons/godot-rapier2d/bin/libphysics_server_rapier2d.ios.template_release.dylib
if: ${{ env.APPLE_DEV_ID }}

- name: Upload ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/upload
with:
precision: ${{ matrix.precision }}
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ name: 🐧 Linux Builds
on:
workflow_call:

# Global Settings
env:
SCONSFLAGS: verbose=yes warnings=extra werror=yes

jobs:
linux:
runs-on: ubuntu-20.04
name: ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
name: ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
strategy:
fail-fast: false
matrix:
target: [template_debug, template_release]
arch: [x86_64]
arch: [{arch: "x86_64", rust: "x86_64-unknown-linux-gnu"}]
precision: [single, double]
features: [simd-stable, enhanced-determinism]

Expand All @@ -24,17 +19,16 @@ jobs:
submodules: true
fetch-depth: 0

- name: Build ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Build ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/build
with:
sconsflags: ${{ env.SCONSFLAGS }}
arch: ${{ matrix.arch }}
arch: ${{ matrix.arch.arch }}
rust_target: ${{ matrix.arch.rust }}
platform: linux
target: ${{ matrix.target }}
precision: ${{ matrix.precision }}
features: ${{ matrix.features }}

- name: Upload ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Upload ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/upload
with:
precision: ${{ matrix.precision }}
Expand Down
26 changes: 10 additions & 16 deletions .github/workflows/macos_builds.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
name: 🍎 macOS Builds
on:
workflow_call:


# Global Settings
env:
SCONSFLAGS: verbose=yes warnings=extra werror=yes

jobs:
macos:
runs-on: "macos-latest"
name: ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
name: ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
strategy:
fail-fast: false
matrix:
target: [template_debug, template_release]
arch: [universal]
arch: [{arch: "universal", rust: "x86_64-apple-darwin"}]
precision: [single, double]
features: [simd-stable, enhanced-determinism]

Expand All @@ -25,18 +19,16 @@ jobs:
submodules: true
fetch-depth: 0

- name: Build ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Build {{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/build
with:
sconsflags: ${{ env.SCONSFLAGS }}
arch: ${{ matrix.arch }}
arch: ${{ matrix.arch.arch }}
rust_target: ${{ matrix.arch.rust }}
platform: macos
rust_target: --target=x86_64-apple-darwin
target: ${{ matrix.target }}
precision: ${{ matrix.precision }}
features: ${{ matrix.features }}

- name: Sign frameworks ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Sign frameworks ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
shell: pwsh
env:
APPLE_CERT_BASE64: ${{ secrets.PROD_MACOS_CERTIFICATE }}
Expand All @@ -45,10 +37,12 @@ jobs:
APPLE_DEV_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
APPLE_DEV_PASSWORD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
APPLE_DEV_APP_ID: ${{ secrets.PROD_MACOS_APPLE_DEV_APP_ID }}
run: ./scripts/ci-sign-macos.ps1 bin/addons/godot-rapier2d/bin/libphysics_server_rapier2d.macos.${{ matrix.target }}.framework
run: |
./scripts/ci-sign-macos.ps1 bin/addons/godot-rapier2d/bin/libphysics_server_rapier2d.macos.template_debug.framework
./scripts/ci-sign-macos.ps1 bin/addons/godot-rapier2d/bin/libphysics_server_rapier2d.macos.template_release.framework
if: ${{ env.APPLE_DEV_ID }}

- name: Upload ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Upload {{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/upload
with:
precision: ${{ matrix.precision }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
needs: static-checks
uses: ./.github/workflows/android_builds.yml

#ios-build: TODO Needs signing anyway
# name: 🍏 iOS
# needs: static-checks
# uses: ./.github/workflows/ios_builds.yml
ios-build:
name: 🍏 iOS
needs: static-checks
uses: ./.github/workflows/ios_builds.yml

linux-build:
name: 🐧 Linux
Expand All @@ -38,7 +38,7 @@ jobs:
name: 🏁 Windows
needs: static-checks
uses: ./.github/workflows/windows_builds.yml

# Needs nightly toolchain, todo investigate more.
#web-build:
# name: 🌐 Web Builds
# needs: static-checks
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@ name: 🌐 Web Builds
on:
workflow_call:

# Global Settings
env:
SCONSFLAGS: verbose=yes warnings=extra werror=yes
EM_VERSION: 3.1.18
EM_CACHE_FOLDER: "emsdk-cache"

jobs:
web:
runs-on: ubuntu-20.04
name: ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
name: ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
strategy:
fail-fast: false
matrix:
target: [template_debug, template_release]
arch: [wasm32]
arch: [{arch: "wasm32", rust: "wasm32-unknown-emscripten"}]
precision: [single, double]
features: [simd-stable, enhanced-determinism]

Expand All @@ -29,24 +22,23 @@ jobs:
- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v12
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
version: 3.1.45
no-cache: true

- name: Verify Emscripten setup
run: |
emcc -v
- name: Build ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Build ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/build
with:
sconsflags: ${{ env.SCONSFLAGS }}
arch: ${{ matrix.arch }}
platform: javascript
target: ${{ matrix.target }}
arch: ${{ matrix.arch.arch }}
rust_target: ${{ matrix.arch.rust }}
platform: web
precision: ${{ matrix.precision }}
features: ${{ matrix.features }}
features: ${{ matrix.features }},wasm-bindgen

- name: Upload ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Upload ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/upload
with:
precision: ${{ matrix.precision }}
Expand Down
18 changes: 6 additions & 12 deletions .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@ name: 🏁 Windows Builds
on:
workflow_call:

# Global Settings
env:
SCONSFLAGS: verbose=yes warnings=extra werror=yes

jobs:
build-windows:
runs-on: "windows-latest"
name: ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
name: ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
strategy:
fail-fast: false
matrix:
target: [template_debug, template_release]
arch: [x86_64] # Rust doesn't have built in config for 32 bit windows build.
arch: [{arch: "x86_64", rust: "x86_64-pc-windows-msvc"}]
precision: [single, double]
features: [simd-stable, enhanced-determinism]

Expand All @@ -26,17 +21,16 @@ jobs:
- name: Setup MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master

- name: Build ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Build ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/build
with:
sconsflags: ${{ env.SCONSFLAGS }}
arch: ${{ matrix.arch }}
arch: ${{ matrix.arch.arch }}
rust_target: ${{ matrix.arch.rust }}
platform: windows
target: ${{ matrix.target }}
precision: ${{ matrix.precision }}
features: ${{ matrix.features }}

- name: Upload ${{ matrix.target }} ${{ matrix.arch }} ${{ matrix.precision }} ${{ matrix.features }}
- name: Upload ${{ matrix.arch.arch }} ${{ matrix.precision }} ${{ matrix.features }}
uses: ./.github/actions/upload
with:
precision: ${{ matrix.precision }}
Expand Down
Loading

0 comments on commit ac0cac6

Please sign in to comment.