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

Introduce Godot Rust Script #7

Merged
merged 8 commits into from
Jan 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
2 changes: 1 addition & 1 deletion .github/build_godot_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ done

godot_job=$(jobs -p)

kill $godot_job
kill -s TERM $godot_job
41 changes: 34 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
env:
TARGET_TRIPLET: ${{ matrix.arch }}-${{ matrix.vendor }}-${{ matrix.platform }}${{ matrix.env }}
CARGO_BUILD: cargo build --target
RUST_BACKTRACE: full

steps:
- name: checkout
Expand All @@ -62,7 +63,7 @@ jobs:
if: inputs.release
run: |
cd native/
${{ env.CARGO_BUILD}} ${{ env.TARGET_TRIPLET}} --release
${{ env.CARGO_BUILD }} ${{ env.TARGET_TRIPLET}} --release
- name: Artifacts
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -129,27 +130,53 @@ jobs:
uses: actions/download-artifact@v3
with:
name: libnative-linux-x86_64
path: native/target/x86_64-unknown-linux-gnu/release/
path: native/target/x86_64-unknown-linux-gnu/debug/
- name: download x86_64 libs
if: matrix.x86_64
uses: actions/download-artifact@v3
with:
name: libnative-${{ matrix.platform }}-x86_64
path: native/target/x86_64-${{ matrix.vendor }}-${{ matrix.platform }}${{ matrix.env }}/release/
path: native/target/x86_64-${{ matrix.vendor }}-${{ matrix.platform }}${{ matrix.env }}/debug/
- name: download aarch64 libs
if: matrix.aarch64
uses: actions/download-artifact@v3
with:
name: libnative-${{ matrix.platform }}-aarch64
path: native/target/aarch64-${{ matrix.vendor }}-${{ matrix.platform }}${{ matrix.env }}/release/
path: native/target/aarch64-${{ matrix.vendor }}-${{ matrix.platform }}${{ matrix.env }}/debug/
- name: create universal libnative
if: matrix.platform == 'darwin'
run: |
platform_dir="${{ matrix.vendor }}-${{ matrix.platform }}"
mkdir -p native/target/universal-$platform_dir/release/
lipo -create native/target/x86_64-$platform_dir/release/${{ matrix.lib }} native/target/aarch64-$platform_dir/release/${{ matrix.lib }} -output native/target/universal-$platform_dir/release/${{ matrix.lib }}
mkdir -p native/target/universal-$platform_dir/debug/
lipo -create native/target/x86_64-$platform_dir/debug/${{ matrix.lib }} native/target/aarch64-$platform_dir/debug/${{ matrix.lib }} -output native/target/universal-$platform_dir/debug/${{ matrix.lib }}
- name: copy libs
run: |
set -x
platform_dir="${{ matrix.vendor }}-${{ matrix.platform }}${{ matrix.env }}"
x86_64="native/target/x86_64-$platform_dir"
aarch64="native/target/aarch64-$platform_dir"
universal="native/target/universal-$platform_dir"

if [[ -d "$x86_64/debug/" ]]; then
mkdir -p "$x86_64/release/"
cp $x86_64/debug/* "$x86_64/release/"
fi

if [[ -d "$aarch64/debug/" ]]; then
mkdir -p "$aarch64/release/"
cp $aarch64/debug/* "$aarch64/release/"
fi

if [[ -d "$universal/debug/" ]]; then
mkdir -p "$universal/release/"
cp $universal/debug/* "$universal/release/"
fi
- name: import godot project
run: .github/build_godot_cache.sh
run: |
# import assets
.github/build_godot_cache.sh
# restart to make sure all rust scripts are detected
.github/build_godot_cache.sh
- name: export-debug
if: ${{ !inputs.release }}
run: |
Expand Down
Loading
Loading