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.

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