test #130
This file contains 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
name: Release | |
on: [push] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CARGO_TERM_COLOR: always | |
jobs: | |
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: list clangs | |
run: | | |
which -a clang | |
which -a cc | |
clang --version | |
cc --version | |
- name: Install Rust Windows target | |
run: rustup update && rustup target add x86_64-pc-windows-gnu | |
- name: Build bqn shared lib and wasm file | |
run: | | |
sudo apt-get update | |
sudo apt-get install clang llvm | |
git clone https://github.com/dzaima/CBQN | |
cd CBQN | |
FFI=0 make shared-o3 notui=1 | |
FFI=0 make wasi-reactor-o3 notui=1 | |
mv libcbqn.so BQN.wasm ../ | |
- name: Build Linux | |
run: | | |
RUSTFLAGS="-L ${{ github.workspace }}" LD_LIBRARY_PATH="${{ github.workspace }}/libcbqn.so" cargo build --release | |
mv target/release/beacon ./beacon_x86_64-unknown-linux-gnu | |
- name: Build Windows | |
run: | | |
BQN_WASM=${{ github.workspace }}/BQN.wasm cargo build --release --target x86_64-pc-windows-gnu --no-default-features --features=bqnwasm | |
mv target/x86_64-pc-windows-gnu/release/beacon ./beacon_x86_64-pc-windows-gnu.exe | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./beacon_x86_64-unknown-linux-gnu ./beacon_x86_64-pc-windows-gnu.exe | |
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 Rust ARM target | |
run: | | |
rustup update && rustup target add aarch64-apple-darwin | |
cargo install cargo-bundle || echo "already installed" | |
- name: Build x86 | |
run: | | |
git clone https://github.com/dzaima/CBQN | |
cd CBQN | |
FFI=0 make shared-o3 notui=1 | |
mv libcbqn.dylib .. | |
cd .. | |
RUSTFLAGS="-L ${{ github.workspace }}" LD_LIBRARY_PATH="${{ github.workspace }}/libcbqn_86.dylib" cargo bundle --release | |
- name: Build ARM | |
run: | | |
rm libcbqn.dylib | |
cd CBQN | |
FFI=0 CCFLAGS=--target=aarch64-apple-darwin make shared-o3 target_arch=aarch64 notui=1 | |
mv libcbqn.dylib .. | |
cd .. | |
RUSTFLAGS="-L ${{ github.workspace }}" LD_LIBRARY_PATH="${{ github.workspace }}/libcbqn_arm.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_aarch64-apple-darwin.dmg target/aarch64-apple-darwin/release/bundle/osx/Beacon.app | |
./create-dmg/create-dmg Beacon_x86_64-apple-darwin.dmg target/release/bundle/osx/Beacon.app | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: Beacon_aarch64-apple-darwin.dmg Beacon_x86_64-apple-darwin.dmg |