wulkanowy-mod/.github/workflows/android.yml

55 lines
1.7 KiB
YAML
Raw Normal View History

2024-03-01 02:18:08 -06:00
name: Generate APK
env:
2024-03-20 13:48:40 -05:00
# The name of the main module repository
main_project_module: app
2024-03-01 02:18:08 -06:00
2024-02-29 08:57:28 -06:00
on:
2024-03-20 13:48:40 -05:00
push:
branches:
- 'develop'
2024-03-01 02:18:08 -06:00
2024-03-20 13:48:40 -05:00
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
2024-02-29 08:57:28 -06:00
jobs:
2024-03-20 13:48:40 -05:00
build:
runs-on: ubuntu-latest
steps:
2024-03-20 14:53:10 -05:00
- 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 '${{ 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: 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: Build debug APK
run: ./gradlew assembleDebug
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
app/build/outputs/**/*-debug.apk
2024-03-20 15:08:16 -05:00
name: Release ${{ env.VERSION_NAME }} (${{ env.date_today }})
2024-03-20 15:10:52 -05:00
tag_name: v${{ env.VERSION_NAME }}
generate_release_notes: true