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.

92 lines
3.0 KiB

  1. name: Android
  2. on:
  3. workflow_dispatch:
  4. push:
  5. workflow_dispatch:
  6. paths:
  7. - 'src/**'
  8. - 'examples/**'
  9. - '.github/workflows/android.yml'
  10. pull_request:
  11. paths:
  12. - 'src/**'
  13. - 'examples/**'
  14. - '.github/workflows/android.yml'
  15. release:
  16. types: [published]
  17. permissions:
  18. contents: read
  19. jobs:
  20. build:
  21. permissions:
  22. contents: write # for actions/upload-release-asset to upload release asset
  23. runs-on: windows-latest
  24. strategy:
  25. fail-fast: false
  26. max-parallel: 1
  27. matrix:
  28. ARCH: ["arm64", "x86_64"]
  29. env:
  30. RELEASE_NAME: raylib-dev_android_api29_${{ matrix.ARCH }}
  31. steps:
  32. - name: Checkout
  33. uses: actions/checkout@master
  34. - name: Setup Release Version
  35. run: |
  36. echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_android_api29_${{ matrix.ARCH }}" >> $GITHUB_ENV
  37. shell: bash
  38. if: github.event_name == 'release' && github.event.action == 'published'
  39. - name: Setup Environment
  40. run: |
  41. mkdir build
  42. cd build
  43. mkdir ${{ env.RELEASE_NAME }}
  44. cd ${{ env.RELEASE_NAME }}
  45. mkdir include
  46. mkdir lib
  47. cd ../..
  48. # Generating static + shared library for 64bit arquitectures and API version 29
  49. - name: Build Library
  50. run: |
  51. cd src
  52. make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK="C:\PROGRA~2\Android\android-sdk\ndk-bundle" RAYLIB_LIBTYPE=STATIC RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib"
  53. make PLATFORM=PLATFORM_ANDROID ANDROID_ARCH=${{ matrix.ARCH }} ANDROID_API_VERSION=29 ANDROID_NDK="C:\PROGRA~2\Android\android-sdk\ndk-bundle" RAYLIB_LIBTYPE=SHARED RAYLIB_RELEASE_PATH="../build/${{ env.RELEASE_NAME }}/lib" -B
  54. cd ..
  55. shell: cmd
  56. - name: Generate Artifacts
  57. run: |
  58. cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
  59. cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
  60. cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
  61. cp -v ./CHANGELOG ./build/${{ env.RELEASE_NAME }}/CHANGELOG
  62. cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
  63. cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
  64. cd build
  65. tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
  66. - name: Upload Artifacts
  67. uses: actions/upload-artifact@v2
  68. with:
  69. name: ${{ env.RELEASE_NAME }}.tar.gz
  70. path: ./build/${{ env.RELEASE_NAME }}.tar.gz
  71. - name: Upload Artifact to Release
  72. uses: actions/upload-release-asset@v1.0.1
  73. env:
  74. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  75. with:
  76. upload_url: ${{ github.event.release.upload_url }}
  77. asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
  78. asset_name: ${{ env.RELEASE_NAME }}.tar.gz
  79. asset_content_type: application/gzip
  80. if: github.event_name == 'release' && github.event.action == 'published'