Skip to content

Fix gradle build action #24

Fix gradle build action

Fix gradle build action #24

name: Generated APK AAB (Upload - Create Artifact To Github Action)
env:
# The name of the main module repository
main_project_module: app
on:
push:
branches:
- 'master'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Create google-sevices.json
run: cat /home/runner/work/LFilms/LFilms/app/google-services.json | base64
- name: Putting data
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/LFilms/LFilms/app/google-services.json
# Setuup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
# Execute Gradle build
- name: Execute Gradle build
run: ./gradlew build
- name: Retrieve Version
run: |
echo "::set-output name=VERSION_NAME::$(${{github.workspace}}/gradlew -q printVersionName)"
id: android_version
- name: Get version
run: |
echo "VERSION_NAME=${{steps.android_version.outputs.VERSION_NAME}}" >> $GITHUB_ENV