name: Generate APK env: # The name of the main module repository main_project_module: app on: push: branches: - 'develop' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 # Set Current Date As Env Variable - name: Set current date as env variable run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV # 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: Build Debug APK run: ./gradlew assembleDebug - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} draft: false prerelease: false - name: Upload Debug APK uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: app/build/outputs/apk/debug/*.apk asset_name: debug-${{ env.repository_name }}-${{ env.date_today }}.apk asset_content_type: application/vnd.android.package-archive