Skip to content

build libs on the action #99

build libs on the action

build libs on the action #99

Workflow file for this run

name: Release
on: [push, pull_request]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_TERM_COLOR: always
jobs:
windows:
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build WASM
run: |
git clone https://github.com/dzaima/CBQN
cd CBQN
CC=${{matrix.compiler}} make wasi-reactor-o3
mv BQN.wasm ..
cd ..
- name: Build
run: |
BQN_WASM="D:/a/beacon/beacon/BQN.wasm" cargo build --release --no-default-features --features=bqnwasm
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/release/beacon.exe
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build bqn shared lib
run: |
git clone https://github.com/dzaima/CBQN
cd CBQN
FFI=0 make shared-o3
mv libcbqn.so ../
- name: Build
run: |
RUSTFLAGS="-L ${{ github.workspace }}" LD_LIBRARY_PATH="${{ github.workspace }}/libcbqn.so" cargo build --release
mv target/release/beacon ./beacon_linux
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ./beacon_linux
macos:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install ARM target
run: |
rustup update && rustup target add aarch64-apple-darwin
cargo install cargo-bundle || echo "already installed"
- name: Build bqn shared lib
run: |
git clone https://github.com/dzaima/CBQN
cd CBQN
FFI=0 make shared-o3
mv libcbqn.dylib ../
- name: Build ARM
run: RUSTFLAGS="-L ${{ github.workspace }}" LD_LIBRARY_PATH="${{ github.workspace }}/libcbqn.dylib" cargo bundle --release
#--target=aarch64-apple-darwin
- name: Create DMG
run: |
git clone https://github.com/create-dmg/create-dmg
chmod u+x create-dmg/create-dmg
./create-dmg/create-dmg Beacon.dmg target/aarch64-apple-darwin/release/bundle/osx/Beacon.app
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: Beacon.dmg