You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. name: macOS
  2. on:
  3. push:
  4. pull_request:
  5. release:
  6. types: [published]
  7. jobs:
  8. build:
  9. runs-on: macos-latest
  10. env:
  11. RELEASE_NAME: raylib-dev_macos
  12. steps:
  13. - name: Checkout
  14. uses: actions/checkout@master
  15. - name: Setup Release Version
  16. run: |
  17. echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_macos" >> $GITHUB_ENV
  18. shell: bash
  19. if: github.event_name == 'release' && github.event.action == 'published'
  20. - name: Setup Environment
  21. run: |
  22. mkdir build
  23. cd build
  24. mkdir ${{ env.RELEASE_NAME }}
  25. cd ${{ env.RELEASE_NAME }}
  26. mkdir include
  27. mkdir lib
  28. cd ../..
  29. # Generating static + shared library, note that i386 architecture is deprecated
  30. # Defining GL_SILENCE_DEPRECATION because OpenGL is deprecated on macOS
  31. # TODO: Support Universal ARCH libraries (build arm64 + x86_64 and merge)
  32. - name: Build Library
  33. run: |
  34. cd src
  35. clang --version
  36. 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"
  37. # make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC RAYLIB_LIB_NAME=raylib_x86_64 CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION"
  38. # make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=STATIC RAYLIB_LIB_NAME=raylib_arm64 CFLAGS="-target arm64-apple-macos11 -DGL_SILENCE_DEPRECATION" -B
  39. # lipo -create -output ../build/${{ env.RELEASE_NAME }}/lib/libraylib.a libraylib_x86_64.a libraylib_arm64.a
  40. make clean
  41. 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"
  42. # make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_LIB_NAME=raylib_x86_64 CFLAGS="-target x86_64-apple-macos10.12 -DGL_SILENCE_DEPRECATION" -B
  43. # make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED RAYLIB_LIB_NAME=raylib_arm64 CFLAGS="-target i686-apple-macos -DGL_SILENCE_DEPRECATION" -B
  44. # 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
  45. # cp -v ./libraylib_arm64.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.dylib
  46. # cp -v ./libraylib_arm64.310.dylib ../build/${{ env.RELEASE_NAME }}/lib/libraylib.310.dylib
  47. cd ..
  48. - name: Generate Artifacts
  49. run: |
  50. cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
  51. cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
  52. cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
  53. cd build
  54. tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
  55. - name: Upload Artifacts
  56. uses: actions/upload-artifact@v2
  57. with:
  58. name: ${{ env.RELEASE_NAME }}.tar.gz
  59. path: ./build/${{ env.RELEASE_NAME }}.tar.gz
  60. - name: Upload Artifact to Release
  61. uses: actions/upload-release-asset@v1.0.1
  62. env:
  63. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  64. with:
  65. upload_url: ${{ github.event.release.upload_url }}
  66. asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
  67. asset_name: ${{ env.RELEASE_NAME }}.tar.gz
  68. asset_content_type: application/gzip
  69. if: github.event_name == 'release' && github.event.action == 'published'