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.

94 lines
3.1 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
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
4 years ago
  1. name: Linux
  2. on:
  3. push:
  4. pull_request:
  5. release:
  6. types: [published]
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. strategy:
  11. fail-fast: false
  12. max-parallel: 1
  13. matrix:
  14. bits: [32, 64]
  15. include:
  16. - bits: 32
  17. ARCH: "i386"
  18. ARCH_NAME: "i386"
  19. COMPILER_PATH: "/user/bin"
  20. - bits: 64
  21. ARCH: "x86_64"
  22. ARCH_NAME: "amd64"
  23. COMPILER_PATH: "/user/bin"
  24. env:
  25. RELEASE_NAME: raylib-dev_linux_${{ matrix.ARCH_NAME }}
  26. steps:
  27. - name: Checkout code
  28. uses: actions/checkout@master
  29. - name: Setup Release Version
  30. run: |
  31. echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_linux_${{ matrix.ARCH_NAME }}" >> $GITHUB_ENV
  32. shell: bash
  33. if: github.event_name == 'release' && github.event.action == 'published'
  34. - name: Setup Environment
  35. run: |
  36. sudo apt-get update -qq
  37. sudo apt-get install gcc-multilib
  38. sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev
  39. mkdir build
  40. cd build
  41. mkdir ${{ env.RELEASE_NAME }}
  42. cd ${{ env.RELEASE_NAME }}
  43. mkdir include
  44. mkdir lib
  45. cd ../../../raylib
  46. # ${{ matrix.ARCH }}-linux-gnu-gcc -v
  47. # TODO: Support 32bit (i386) shared library building
  48. - name: Build Library
  49. run: |
  50. cd src
  51. make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" CFLAGS="-m32"
  52. # make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
  53. cd ..
  54. if: matrix.bits == 32
  55. - name: Build Library
  56. run: |
  57. cd src
  58. make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
  59. make PLATFORM=PLATFORM_DESKTOP CC=gcc RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
  60. cd ..
  61. if: matrix.bits == 64
  62. - name: Generate Artifacts
  63. run: |
  64. cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
  65. cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
  66. cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
  67. cd build
  68. tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
  69. - name: Upload Artifacts
  70. uses: actions/upload-artifact@v2
  71. with:
  72. name: ${{ env.RELEASE_NAME }}.tar.gz
  73. path: ./build/${{ env.RELEASE_NAME }}.tar.gz
  74. - name: Upload Artifact to Release
  75. uses: actions/upload-release-asset@v1.0.1
  76. env:
  77. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  78. with:
  79. upload_url: ${{ github.event.release.upload_url }}
  80. asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
  81. asset_name: ${{ env.RELEASE_NAME }}.tar.gz
  82. asset_content_type: application/gzip
  83. if: github.event_name == 'release' && github.event.action == 'published'