Skip to content

Commit

Permalink
improve build env
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanNano committed Jan 29, 2024
1 parent 0b10e9e commit bd7a084
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
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
38 changes: 32 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,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
4 changes: 2 additions & 2 deletions native/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ rayon = "1.5.1"
itertools = "0.10.3"
num_enum = "0.7.1"

godot-rust-script = { git = "https://github.com/titannano/godot-rust-script", rev = "e36bf269cdac05b1a2280dbf39229f9279ec871a" }
godot-rust-script = { git = "https://github.com/titannano/godot-rust-script", rev = "5d96527d48544521b44a2952b7e5f0257f5110ae" }

0 comments on commit bd7a084

Please sign in to comment.