Try to make a build that works for M1 Macs #158
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: compile | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
compile: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu, windows, macos] | |
# Probably need different architectures too, e.g. M1 Macs? | |
runs-on: ${{ matrix.os }}-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache nimble | |
id: cache-nimble | |
uses: actions/cache@v1 | |
with: | |
path: ~/.nimble | |
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} | |
if: runner.os != 'Windows' | |
- uses: jiro4989/setup-nim-action@v1 | |
# Fix SSL error with choosenim | |
- run: | | |
curl -fO https://curl.se/ca/cacert.pem | |
install cacert.pem ~/.nimble/bin | |
ls ~/.nimble/bin | |
shell: bash | |
if: runner.os == 'Windows' | |
- run: | | |
sudo apt-get install gcc-arm-linux-gnueabihf | |
nimble build -d:debug -Y --cpu:arm | |
mv native_main native_main-armhf | |
file native_main-armhf | |
name: armhf build | |
if: runner.os == 'Linux' | |
- run: nimble build -d:debug -Y --verbose | |
- run: | | |
mv native_main.exe native_main | |
shell: bash | |
if: runner.os == 'Windows' | |
- run: | | |
mv native_main native_main-x86 | |
nimble build --verbose -d:debug -Y '--passC:"-target arm64-apple-macos11"' '--passL:"-target arm64-apple-macos11"' | |
mv native_main native_main-arm64 | |
lipo -create -output native_main native_main-x86 native_main-arm64 | |
if: runner.os == 'macOS' | |
# - run: nimble test -Y | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: native_main-${{ runner.os }} | |
path: native_main | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
if: runner.os == 'Linux' | |
with: | |
name: native_main-armhf-${{ runner.os }} | |
path: native_main-armhf |