Skip to content

Build Android

Build Android #25

name: Build Android
on: workflow_dispatch
jobs:
android-template:
name: Compiling Gradle (Android)
runs-on: "ubuntu-latest"
strategy:
matrix:
GODOT_VERSIONS: [3.5, 3.5.1, 3.5.2, 3.5.3, 4.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.1, 4.1.1, 4.1.2, 4.1.3]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Set up Java
uses: actions/setup-java@v2
with:
java-version: 17
distribution: "temurin"
- name: Set plugin version on env
run: |
PLUGIN_VERSION=$(find . -name "*.java" -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: Build Android Action
id: build-android
uses: poingstudios/godot-android-action@master
with:
godot_version: ${{matrix.GODOT_VERSIONS}}
project_path: admob
gdap_file_path: admob/AdMob.gdap
- uses: actions/download-artifact@v3
with:
name: ${{ steps.build-android.outputs.artifact_name }}
path: artifacts_output
- name: Compress the artifact output
run: |
OUTPUT_FILENAME=android-template-v${{env.CURRENT_GODOT_VERSION}}.zip
echo "OUTPUT_FILENAME=${OUTPUT_FILENAME}" >> $GITHUB_ENV
zip -r ${OUTPUT_FILENAME} .
ls -R
working-directory: artifacts_output
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
target_commit: ${{ github.ref_name }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts_output/${{ env.OUTPUT_FILENAME }}
tag: ${{env.PLUGIN_VERSION}}
overwrite: true