raylib/.github/workflows/macos.yml

72 lines
3.1 KiB
YAML
Raw Normal View History

2020-08-17 22:04:20 +03:00
name: macOS
2020-08-19 18:20:44 +03:00
on:
push:
pull_request:
release:
types: [published]
jobs:
build:
runs-on: macos-latest
2020-08-18 15:12:55 +03:00
env:
RELEASE_NAME: raylib-3.1_macos
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Environment
run: |
mkdir build
cd build
2020-08-18 15:12:55 +03:00
mkdir ${{ env.RELEASE_NAME }}
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
2020-08-18 15:12:55 +03:00
cd ../..
2020-08-19 11:43:48 +03:00
# Generating static + shared library, note that i386 architecture is deprecated
# Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS
2020-08-19 18:20:44 +03:00
# TODO: Support Universal ARCH libraries (build arm64 + x86_64 and merge)
- name: Build Library
run: |
cd src
2020-08-19 20:12:17 +03:00
clang --version
2020-08-19 20:55:11 +03:00
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
# make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC RAYLIB_LIB_NAME=raylib_x86_64 CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
2020-08-19 20:50:47 +03:00
# make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC RAYLIB_LIB_NAME=raylib_arm64 CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B
# lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.a libraylib_x86_64.a libraylib_arm64.a
2020-08-18 15:12:55 +03:00
make clean
2020-08-19 20:55:11 +03:00
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
# make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_LIB_NAME=raylib_x86_64 CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" -B
2020-08-19 20:50:47 +03:00
# make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_LIB_NAME=raylib_arm64 CFLAGS="-target i686-apple-macos -DGL_SILENCE_DEPRECATION" -B
# lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.3.1.0.dylib libraylib_x86_64.3.1.0.dylib libraylib_arm64.3.1.0.dylib
# cp -v ./libraylib_arm64.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.dylib
# cp -v ./libraylib_arm64.310.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.310.dylib
cd ..
- name: Generate Artifacts
run: |
2020-08-18 15:12:55 +03:00
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
cd build
2020-08-19 11:39:57 +03:00
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
2020-08-17 22:04:58 +03:00
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
2020-08-18 15:12:55 +03:00
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
2020-08-19 18:20:44 +03:00
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
2020-08-19 19:48:16 +03:00
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
2020-08-19 18:20:44 +03:00
if: github.event_name == 'release' && github.event.action == 'published'