2024-05-12 06:01:11 -05:00
|
|
|
name: Generate debug APK
|
|
|
|
|
|
|
|
env:
|
|
|
|
main_project_module: app
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'develop'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set current date as env variable
|
|
|
|
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Set repository name as env variable
|
|
|
|
run: echo "repository_name=$(echo '${{ gitea.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'
|
|
|
|
|
2024-05-12 12:19:14 -05:00
|
|
|
- name: Cache Gradle
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
|
|
|
|
|
2024-05-12 06:01:11 -05:00
|
|
|
- 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
|
|
|
|
|
|
|
|
- name: Setup Android SDK
|
|
|
|
uses: android-actions/setup-android@v3
|
|
|
|
|
|
|
|
- name: Build release APK
|
|
|
|
run: ./gradlew assembleRelease
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
2024-05-12 12:08:38 -05:00
|
|
|
uses: actions/upload-artifact@v3 # not v4 because of GHES
|
2024-05-12 06:01:11 -05:00
|
|
|
with:
|
2024-05-12 12:19:14 -05:00
|
|
|
name: wulkanowy_mod_release.apk
|
2024-05-12 06:01:11 -05:00
|
|
|
path: |
|
2024-05-12 06:39:55 -05:00
|
|
|
app/build/outputs/**/*-release-unsigned.apk
|
2024-05-12 06:01:11 -05:00
|
|
|
|
|
|
|
- name: Create release
|
|
|
|
uses: akkuman/gitea-release-action@v1
|
|
|
|
env:
|
|
|
|
NODE_OPTIONS: '--experimental-fetch'
|
|
|
|
with:
|
|
|
|
files: |
|
2024-05-12 06:03:43 -05:00
|
|
|
app/build/outputs/**/*-release-unsigned.apk
|
2024-05-12 06:01:11 -05:00
|
|
|
|
|
|
|
name: Release ${{ env.VERSION_NAME }} (${{ env.date_today }})
|
|
|
|
tag_name: v${{ env.VERSION_NAME }}
|