Added F-Droid metadata #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build | |
on: | |
push: | |
pull_request: | |
env: | |
main_project_module: 'app' | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout repository | |
# 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@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
cache: 'gradle' | |
- name: Change wrapper permissions | |
run: chmod +x ./gradlew | |
# Run Build Project | |
- name: Build gradle project | |
run: ./gradlew build | |
# Create APK Debug | |
- name: Build apk debug project (APK) | |
run: ./gradlew assembleDebug | |
# Create APK Release | |
- name: Build apk release project (APK) | |
run: ./gradlew assemble | |
# Create Bundle AAB Release | |
# Noted for main module build [main_project_module]:bundleRelease | |
- name: Build app bundle release (AAB) | |
run: ./gradlew ${{ env.main_project_module }}:bundleRelease | |
# Upload Artifact Build | |
# Noted For Output [main_project_module]/build/outputs/apk/debug/ | |
- name: Upload APK Debug | |
uses: actions/upload-artifact@v4 | |
with: | |
name: apk-debug | |
path: ${{ env.main_project_module }}/build/outputs/apk/debug/ | |
# Noted For Output [main_project_module]/build/outputs/apk/release/ | |
- name: Upload APK Release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: apk-release | |
path: ${{ env.main_project_module }}/build/outputs/apk/release/ | |
# Noted For Output [main_project_module]/build/outputs/bundle/release/ | |
- name: Upload AAB (App Bundle) Release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aab-bundles | |
path: ${{ env.main_project_module }}/build/outputs/bundle/release/ | |
release: | |
runs-on: ubuntu-22.04 | |
needs: build | |
# Only run if tag pushed | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download Artifact (Debug) | |
uses: actions/download-artifact@v4 | |
with: | |
name: apk-debug | |
path: ${{ github.workspace }}/artifacts-debug | |
- name: Download APK (Release) | |
uses: actions/download-artifact@v4 | |
with: | |
name: apk-release | |
path: ${{ github.workspace }}/artifacts-release | |
- name: Download App Bundle | |
uses: actions/download-artifact@v4 | |
with: | |
name: aab-bundles | |
path: ${{ github.workspace }}/artifacts-bundle | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: | | |
${{ github.workspace }}/artifacts-release/app-release-unsigned.apk | |
${{ github.workspace }}/artifacts-debug/app-debug.apk | |
${{ github.workspace }}/artifacts-bundle/app-release.aab |