diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 253edda..cd08be4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,24 +16,40 @@ jobs: - os_name: Linux-x86_64 os: ubuntu-20.04 target: x86_64-unknown-linux-gnu + origin_dylib_suffix: so + dest_dylib_suffix: so + - os_name: macOS-x86_64 os: macOS-latest target: x86_64-apple-darwin + origin_dylib_suffix: dylib + dest_dylib_suffix: so + - os_name: macOS-aarch64 os: macOS-latest target: aarch64-apple-darwin + origin_dylib_suffix: dylib + dest_dylib_suffix: so + toolchain: - stable steps: - uses: actions/checkout@v3 - - name: Build binary + - name: Build library uses: houseabsolute/actions-rust-cross@v0 with: command: "build" target: ${{ matrix.platform.target }} toolchain: ${{ matrix.toolchain }} - args: "--locked --release --manifest-path ./generator/Cargo.toml" + args: "--release --manifest-path ./generator/Cargo.toml" + - name: Rename dynamic lib + run: cp genator/target/release/libgenerator.${{ matrix.platform.origin_dylib_suffix }} lua/generator.${{ matrix.platform.dest_dylib_suffix }} + + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + message: "[Update] build FFI dynamic library" # - name: Rename binary (linux and macos) # run: mv target/${{ matrix.platform.target }}/release/figctl target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} # if: matrix.platform.os_name != 'Windows-x86_64' diff --git a/generator/.cargo/config b/generator/.cargo/config deleted file mode 100644 index d47f983..0000000 --- a/generator/.cargo/config +++ /dev/null @@ -1,11 +0,0 @@ -[target.x86_64-apple-darwin] -rustflags = [ - "-C", "link-arg=-undefined", - "-C", "link-arg=dynamic_lookup", -] - -[target.aarch64-apple-darwin] -rustflags = [ - "-C", "link-arg=-undefined", - "-C", "link-arg=dynamic_lookup", -]