Skip to content

Workflow file for this run

name: build and release
on: push
permissions:
contents: write
jobs:
build:
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- 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 library
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--release --manifest-path ./generator/Cargo.toml"
- name: Rename dynamic lib
run: cp generator/target/${{ matrix.platform.target }}/release/libgenerator.${{ matrix.platform.origin_dylib_suffix }} lua/${{ matrix.platform.os_name }}generator.${{ matrix.platform.dest_dylib_suffix }}
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
tag_push: '--force'
pull: '--rebase'
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'
#
# - name: Rename binary (windows)
# run: mv target/${{ matrix.platform.target }}/release/figctl.exe target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
# if: matrix.platform.os_name == 'Windows-x86_64'
# - name: Generate SHA-256
# run: shasum -a 256 target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} | cut -d ' ' -f 1 > target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256
#
# - name: Release binary and SHA-256 checksum to GitHub
# uses: softprops/action-gh-release@v1
# with:
# files: |
# target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}
# target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }}.sha256