Skip to content

update

update #2

Workflow file for this run

name: Android Release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --info
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Find APKs
id: find_apks
run: |
debug_apk_path=$(ls app/build/outputs/apk/debug/*.apk)
debug_apk_name=$(basename ${debug_apk_path})
echo "debug_apk_path: ${debug_apk_path}"
echo "debug_apk_name: ${debug_apk_name}"
echo "debug_apk_path=${debug_apk_path}" >> $GITHUB_OUTPUT
echo "debug_apk_name=${debug_apk_name}" >> $GITHUB_OUTPUT
release_apk_path=$(ls app/build/outputs/apk/release/*.apk)
release_apk_name=$(basename ${release_apk_path})
echo "release_apk_path: ${release_apk_path}"
echo "release_apk_name: ${release_apk_name}"
echo "release_apk_path=${release_apk_path}" >> $GITHUB_OUTPUT
echo "release_apk_name=${release_apk_name}" >> $GITHUB_OUTPUT
- 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: ${{ steps.find_apks.outputs.debug_apk_path }}
asset_name: ${{ steps.find_apks.outputs.debug_apk_name }}
asset_content_type: application/zip
- name: Upload Release APK
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.find_apks.outputs.release_apk_path }}
asset_name: ${{ steps.find_apks.outputs.release_apk_name }}
asset_content_type: application/zip