raylib/.github/workflows/android.yml

88 lines
2.9 KiB
YAML
Raw Normal View History

2020-08-19 15:05:13 +03:00
name: Android
on:
workflow_dispatch:
2020-08-19 15:05:13 +03:00
push:
workflow_dispatch:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/android.yml'
2020-08-19 15:05:13 +03:00
pull_request:
paths:
- 'src/**'
- 'examples/**'
- '.github/workflows/android.yml'
2020-08-19 15:05:13 +03:00
release:
types: [published]
jobs:
build:
runs-on: windows-latest
2020-08-19 17:43:12 +03:00
strategy:
fail-fast: false
max-parallel: 1
matrix:
2020-08-19 17:52:11 +03:00
ARCH: ["arm64", "x86_64"]
2020-08-19 17:43:12 +03:00
2020-08-19 15:05:13 +03:00
env:
2020-12-25 04:05:39 +03:00
RELEASE_NAME: raylib-dev_android_api29_${{ matrix.ARCH }}
2020-08-19 15:05:13 +03:00
steps:
- name: Checkout
uses: actions/checkout@master
2020-08-21 14:16:30 +03:00
- name: Setup Release Version
run: |
2020-12-25 04:05:39 +03:00
echo "RELEASE_NAME=raylib-${{ github.event.release.tag_name }}_android_api29_${{ matrix.ARCH }}" >> $GITHUB_ENV
2020-08-21 14:16:30 +03:00
shell: bash
if: github.event_name == 'release' && github.event.action == 'published'
2020-08-19 15:05:13 +03:00
- name: Setup Environment
run: |
mkdir build
cd build
mkdir ${{ env.RELEASE_NAME }}
cd ${{ env.RELEASE_NAME }}
mkdir include
mkdir lib
cd ../..
2020-12-25 04:05:39 +03:00
# Generating static + shared library for 64bit arquitectures and API version 29
2020-08-19 15:05:13 +03:00
- name: Build Library
run: |
cd src
2020-12-25 04:05:39 +03:00
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"
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
2020-08-19 15:05:13 +03:00
cd ..
2020-08-19 16:47:54 +03:00
shell: cmd
2020-08-19 15:05:13 +03:00
- name: Generate Artifacts
run: |
cp -v ./src/raylib.h ./build/${{ env.RELEASE_NAME }}/include
2021-11-04 22:08:45 +03:00
cp -v ./src/raymath.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./src/rlgl.h ./build/${{ env.RELEASE_NAME }}/include
cp -v ./src/extras/raygui.h ./build/${{ env.RELEASE_NAME }}/include
2021-02-09 17:54:12 +03:00
cp -v ./README.md ./build/${{ env.RELEASE_NAME }}/README.md
cp -v ./LICENSE ./build/${{ env.RELEASE_NAME }}/LICENSE
2020-08-19 15:05:13 +03:00
cd build
tar -czvf ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ env.RELEASE_NAME }}.tar.gz
path: ./build/${{ env.RELEASE_NAME }}.tar.gz
2020-08-19 18:39:43 +03:00
- name: Upload Artifact to Release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
2020-08-19 19:48:44 +03:00
asset_path: ./build/${{ env.RELEASE_NAME }}.tar.gz
asset_name: ${{ env.RELEASE_NAME }}.tar.gz
asset_content_type: application/gzip
2020-08-19 18:39:43 +03:00
if: github.event_name == 'release' && github.event.action == 'published'