diff --git a/.github/build-x86_64-apple-darwin b/.github/build-x86_64-apple-darwin new file mode 100644 index 00000000000..784d58ec90c --- /dev/null +++ b/.github/build-x86_64-apple-darwin @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +echo ✨ System Info +sw_vers +echo ✨ System Details +uname -a +echo ✨ LLVM Version +llvm-config --version + +echo ✨ CMAKE_CXX_COMPILER=$CMAKE_CXX_COMPILER +echo ✨ CMAKE_C_COMPILER=$CMAKE_C_COMPILER + +# llvm@11 paths +export CC=/usr/local/opt/llvm@11/bin/clang +export CXX=/usr/local/opt/llvm@11/bin/clang++ + +export PATH="/usr/local/opt/llvm@11/bin:$PATH" +export LDFLAGS="-L/usr/local/opt/llvm@11/lib" +export CPPFLAGS="-I/usr/local/opt/llvm@11/include" + +echo ✨ clang -v +clang -v +echo ✨ clang++ -v +clang++ -v + +echo ✨ LD_LIBRARY_PATH=$LD_LIBRARY_PATH + +echo ✨ CC=$CC +echo ✨ CXX=$CXX +echo ✨ LIBS=$LIBS + +# fix clang path's to bb expectations +sudo mkdir -p /usr/local/opt/llvm/bin/ +sudo ln -s $(which $CC) /usr/local/opt/llvm/bin/clang +sudo ln -s $(which $CXX) /usr/local/opt/llvm/bin/clang++ + +#fix libomp path +sudo mkdir -p /usr/local/lib/ +sudo ln -s /usr/local/Cellar/libomp/15.0.3/lib/libomp.a /usr/local/lib/libomp.a +ls /usr/local/Cellar/libomp/15.0.3/lib + +echo ✨ /usr/local/opt/llvm/bin/clang --version +/usr/local/opt/llvm/bin/clang --version +echo ✨ /usr/local/opt/llvm/bin/clang++ --version +/usr/local/opt/llvm/bin/clang++ --version + +echo ✨ rustup target add x86_64-apple-darwin +rustup target add x86_64-apple-darwin + +echo 👷 Cargo Build +cargo build --release --locked --target x86_64-apple-darwin \ No newline at end of file diff --git a/.github/workflows/publish-x86_64-apple-darwin.yml b/.github/workflows/publish-x86_64-apple-darwin.yml new file mode 100644 index 00000000000..581bb48d101 --- /dev/null +++ b/.github/workflows/publish-x86_64-apple-darwin.yml @@ -0,0 +1,61 @@ +name: build-x86_64-apple-darwin + +on: + push: + tags: + - "v*" + +jobs: + build-mac: + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - 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: Rust toolchain Install + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-apple-darwin + default: true + override: true + + - name: Tools adn Dependencies Install + run: | + echo ✨ brew config + brew config + echo ✨ brew install pkg-config cmake llvm@11 libomp tree + brew install pkg-config cmake llvm@11 libomp + + - name: Build environment and Compile + run: | + chmod +x ./.github/build-x86_64-apple-darwin + ./.github/build-x86_64-apple-darwin + + - name: Package artifacts + run: | + mkdir dist + cp ./target/x86_64-apple-darwin/release/nargo ./dist/nargo + mkdir -p ./dist/noir-lang/std + cp crates/std_lib/src/*.nr ./dist/noir-lang/std + 7z a -ttar -so -an ./dist | 7z a -si ./nargo-x86_64-apple-darwin.tar.gz + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + ./nargo-x86_64-apple-darwin.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}