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.

74 lines
2.4 KiB

  1. name: Android
  2. on:
  3. push:
  4. pull_request:
  5. release:
  6. types: [published]
  7. jobs:
  8. build:
  9. runs-on: windows-latest
  10. strategy:
  11. fail-fast: false
  12. max-parallel: 1
  13. matrix:
  14. ARCH: ["arm64", "x86_64"]
  15. env:
  16. RELEASE_NAME: raylib-dev_android_api29_${{ matrix.ARCH }}
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@master
  20. - name: Setup Release Version
  21. run: |
  22. echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_android_api29_${{ matrix.ARCH }}" >> $GITHUB_ENV
  23. shell: bash
  24. if: github.event_name == 'release' && github.event.action == 'published'
  25. - name: Setup Environment
  26. run: |
  27. mkdir build
  28. cd build
  29. mkdir ${{ env.RELEASE_NAME }}
  30. cd ${{ env.RELEASE_NAME }}
  31. mkdir include
  32. mkdir lib
  33. cd ../..
  34. # Generating static + shared library for 64bit arquitectures and API version 29
  35. - name: Build Library
  36. run: |
  37. cd src
  38. 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"
  39. 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
  40. cd ..
  41. shell: cmd
  42. - name: Generate Artifacts
  43. run: |
  44. cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
  45. cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
  46. cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
  47. cd build
  48. tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
  49. - name: Upload Artifacts
  50. uses: actions/upload-artifact@v2
  51. with:
  52. name: ${{ env.RELEASE_NAME }}.tar.gz
  53. path: ./build/${{ env.RELEASE_NAME }}.tar.gz
  54. - name: Upload Artifact to Release
  55. uses: actions/upload-release-asset@v1.0.1
  56. env:
  57. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  58. with:
  59. upload_url: ${{ github.event.release.upload_url }}
  60. asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
  61. asset_name: ${{ env.RELEASE_NAME }}.tar.gz
  62. asset_content_type: application/gzip
  63. if: github.event_name == 'release' && github.event.action == 'published'