wulkanowy-mod/.gitea/workflows/build_android.yml

58 lines
1.8 KiB
YAML
Raw Normal View History

2024-05-11 07:45:15 -05:00
name: Generate APK
env:
main_project_module: app
on:
push:
branches:
- 'develop'
jobs:
build:
runs-on: ubuntu-latest
2024-05-11 08:44:25 -05:00
env:
RUNNER_TOOL_CACHE: /toolcache
2024-05-11 07:45:15 -05:00
steps:
2024-05-11 08:11:22 -05:00
- name: Checkout the repository
2024-05-11 07:48:14 -05:00
uses: actions/checkout@v3
2024-05-11 07:45:15 -05:00
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Set repository name as env variable
2024-05-11 08:11:22 -05:00
run: echo "repository_name=$(echo '${{ gitea.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
2024-05-11 07:45:15 -05:00
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'
- name: Get app version
id: get_version
run: echo "VERSION_NAME=$(grep -m1 "versionName" app/build.gradle | awk '{print $2}' | tr -d \''"\')" >> $GITHUB_ENV
- name: Change wrapper permissions
run: chmod +x ./gradlew
2024-05-11 08:11:22 -05:00
- name: Setup Android SDK
uses: android-actions/setup-android@v3
2024-05-11 07:45:15 -05:00
- name: Build debug APK
run: ./gradlew assembleDebug
- name: Create release
uses: akkuman/gitea-release-action@v1
env:
NODE_OPTIONS: '--experimental-fetch'
with:
files: |
2024-05-11 08:11:22 -05:00
app/build/outputs/**/*-debug.apk
2024-05-11 07:45:15 -05:00
name: Release ${{ env.VERSION_NAME }} (${{ env.date_today }})
tag_name: v${{ env.VERSION_NAME }}