0.1.15 #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
permissions: | |
contents: write | |
name: Rust_release | |
on: | |
release: | |
types: [published] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_platforms: | |
name: Build ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
lib_extension: dll | |
lib_prefix: "" | |
- os: ubuntu-latest | |
lib_extension: so | |
lib_prefix: lib | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build Rust library | |
run: | | |
cargo rustc --release --crate-type=cdylib -- -C opt-level=3 -C lto=fat | |
# cargo build --release | |
shell: bash | |
working-directory: ${{ github.workspace }} | |
- name: Create platform directory structure | |
run: | | |
mkdir -p platform_build/hallr/lib | |
# create a dummy file for folder protection | |
cp blender_addon/.hallr platform_build/hallr/ | |
if [ ! -f "platform_build/hallr/.hallr" ]; then | |
touch platform_build/hallr/.hallr | |
fi | |
# Copy Python files | |
cp blender_addon/*.py platform_build/hallr/ | |
# Copy compiled library | |
cp target/release/${{ matrix.lib_prefix }}hallr.${{ matrix.lib_extension }} platform_build/hallr/lib/${{ matrix.lib_prefix }}hallr.${{ matrix.lib_extension }} | |
shell: bash | |
working-directory: ${{ github.workspace }} | |
- name: Upload platform artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: hallr-${{ matrix.os }} | |
path: platform_build | |
include-hidden-files: true | |
build_macos_arm64: | |
name: Build macOS ARM64 | |
runs-on: macos-14 # Uses an Apple Silicon runner | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install ARM target | |
run: rustup target add aarch64-apple-darwin | |
- name: Build ARM64 dylib | |
run: | | |
cargo rustc --release --target aarch64-apple-darwin --crate-type="cdylib" -- -C opt-level=3 -C lto=fat | |
- name: Prepare artifact | |
run: | | |
mkdir -p platform_build/hallr/lib | |
cp blender_addon/.hallr platform_build/hallr/ | |
cp blender_addon/*.py platform_build/hallr/ | |
cp target/aarch64-apple-darwin/release/libhallr.dylib platform_build/hallr/lib/libhallr.dylib | |
- name: Upload macOS arm64 artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: hallr-macos-arm64 | |
path: platform_build | |
include-hidden-files: true | |
combine_artifacts: | |
name: Combine platform artifacts | |
needs: [build_platforms, build_macos_arm64] | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: all_artifacts | |
pattern: "hallr-**" | |
merge-multiple: true | |
- name: Create combined directory structure | |
run: | | |
mkdir -p combined_build/hallr/lib | |
# Make sure the basic structure exists | |
touch combined_build/hallr/.hallr | |
touch combined_build/.hallr | |
# Copy Python files (only need one copy) | |
find all_artifacts -name "*.py" -exec cp -n {} combined_build/hallr/ \; | |
# Copy all library files | |
find all_artifacts -name "*.dll" -exec cp {} combined_build/hallr/lib/ \; | |
find all_artifacts -name "*.so" -exec cp {} combined_build/hallr/lib/ \; | |
find all_artifacts -name "*.dylib" -exec cp {} combined_build/hallr/lib/ \; | |
# List the combined directory structure | |
find combined_build -type f | sort | |
shell: bash | |
working-directory: ${{ github.workspace }} | |
- name: Upload combined artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: hallr | |
path: combined_build | |
include-hidden-files: true | |
- name: Create release zip | |
run: | | |
cd combined_build | |
rm -f hallr/.hallr | |
zip -r ../hallr.zip hallr -x "*.DS_Store" -x "__MACOSX/*" | |
shell: bash | |
working-directory: ${{ github.workspace }} | |
- name: Upload Release Asset | |
run: | | |
gh release upload ${{ github.event.release.tag_name }} hallr.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: ${{ github.workspace }} |