Skip to content

Build Android

Build Android #26

name: Build Android
on: workflow_dispatch
jobs:
android-template:
name: Compiling Gradle (Android)
runs-on: "ubuntu-latest"
strategy:
matrix:
GODOT_VERSIONS: [4.1, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.2, 4.2.1, 4.2.2]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Set plugin version on env
run: |
PLUGIN_VERSION=$(find . -type f \( -name "*.java" -o -name "*.kt" \) -exec grep -H 'PLUGIN_VERSION = ' {} \; | awk -F'"' '{print $2}')
echo "PLUGIN_VERSION=v${PLUGIN_VERSION}" >> $GITHUB_ENV
# Github Actions Matrix doesnt support x.0 values, it's replaced by ''
- name: Verify current matrix's GODOT_VERSIONS
run: |
CURRENT_GODOT_VERSION=${{matrix.GODOT_VERSIONS}}
if [ ${#CURRENT_GODOT_VERSION} -eq 1 ]; then CURRENT_GODOT_VERSION="${CURRENT_GODOT_VERSION}.0"; fi
echo "CURRENT_GODOT_VERSION=${CURRENT_GODOT_VERSION}" >> $GITHUB_ENV
- name: Download and prepare the Stable Godot .AAR LIB
run: |
chmod +x ./scripts/unix/download_godot.sh
./scripts/unix/download_godot.sh ${{env.CURRENT_GODOT_VERSION}}
- name: Build Plugins
run: |
chmod +x ./gradlew
./gradlew build
- name: Compress the artifact output
run: |
./gradlew zipPlugins -PgodotVersion="${{env.CURRENT_GODOT_VERSION}}"
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
target_commit: ${{ github.ref_name }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: .output/poing-godot-admob-android-v${{env.CURRENT_GODOT_VERSION}}.zip
tag: ${{env.PLUGIN_VERSION}}
overwrite: true