Skip to content

Build osx target for release #93

Build osx target for release

Build osx target for release #93

name: 'Build osx target for release'
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release ( ex: v0.0.1 )'
required: true
env:
node-version: 14.x
HOMEBREW_NO_INSTALL_FROM_API:
jobs:
release:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- run: brew config
- run: brew untap homebrew/core homebrew/cask
- run: brew config
- run: brew update --verbose --debug
- name: Log lib
run: |
ls -l /usr/local/lib/
ls -l /usr/lib/
- uses: haskell/actions/setup@v2
with:
ghc-version: "8.10.7"
cabal-version: "3.4.0.0"
stack-version: "2.7.3"
enable-stack: true
- name: Configure stack
run: stack config set system-ghc --global true
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}
- name: Install rollup
run: npm i -g esbuild@v0.20.0
- name: Install LLVM 12
run: brew install llvm-hs/llvm/llvm-12
# run: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=TRUE brew install llvm-hs/llvm/llvm-12
- name: Log lib
run: |
ls -l /usr/local/Cellar/llvm-12/12_2/lib/llvm-12/lib/
ls -l /usr/local/lib/
ls -l /usr/lib/
- name: Fix libc++abi
run: ln -s /usr/local/Cellar/llvm-12/12_2/lib/llvm-12/lib/libc++abi.1.dylib /usr/local/lib/libc++abi.1.dylib
# - name: Fix libffi
# run: ln -s /usr/local/opt/libffi/lib/libffi.dylib /usr/local/opt/libffi/lib/libffi.7.dylib
# - name: Fix llvm install
# run: cd /usr/local/Cellar/llvm-9/9.0.1/bin/ && ln -s llvm-config-9 llvm-config || cd /usr/local/Cellar/llvm-9/9.0.1.reinstall/bin/ && ln -s llvm-config-9 llvm-config
- name: Install alex and happy
run: stack install alex happy
- name: Build madlib executable
run: stack build
# - name: Build madlib executable
# run: |
# export PATH="$PATH:/usr/local/Cellar/llvm-9/9.0.1/bin:/usr/local/Cellar/llvm-9/9.0.1.reinstall/bin"
# stack build
- name: Add rpath
run: install_name_tool -change /usr/local/opt/llvm-12/lib/llvm-12/lib/libc++.1.0.dylib /usr/lib/libc++.1.dylib "$(stack path --dist-dir)/build/madlib/madlib"
- name: Install automake
run: brew install autoconf automake nasm libtool perl
- name: Build runtime
run: |
TARGET="MACOS_X64" ./scripts/build-runtime-libs
TARGET="MACOS_X64" AR="llvm-ar-12" ./scripts/build-runtime
- name: Build tools
run: ./scripts/build
- name: Bundle archive
run: |
mkdir madlib-x86_64-apple-darwin
cp "$(stack path --dist-dir)/build/madlib/madlib" ./madlib-x86_64-apple-darwin/madlib
cp -R runtime ./madlib-x86_64-apple-darwin/
cp -R prelude ./madlib-x86_64-apple-darwin/
cp ./tools/package-installer/dist/package-installer.js ./madlib-x86_64-apple-darwin/
tar -czvf madlib-x86_64-apple-darwin.tar.gz madlib-x86_64-apple-darwin
- uses: pdamianik/release-tag-to-upload-url-action@v1.0.1
id: release_upload_url
with:
tag: ${{ github.event.inputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload build
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_upload_url.outputs.uploadUrl }}
asset_path: ./madlib-x86_64-apple-darwin.tar.gz
asset_name: madlib-x86_64-apple-darwin.tar.gz
asset_content_type: application/tar+gzip