Skip to content

Update build-and-release.yml #18

Update build-and-release.yml

Update build-and-release.yml #18

name: Build and Release
on:
push:
branches:
- master
tags:
- "v*"
jobs:
apk:
name: Generate APK
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Set execution flag for gradlew
run: chmod +x gradlew
- name: Build APK
run: ./gradlew assembleDebug --stacktrace
- name: Rename APK
run: mv presentation/build/outputs/apk/noAnalytics/debug/QKSMS-v*-noAnalytics-debug.apk presentation/build/outputs/apk/noAnalytics/debug/QKSMS-noAnalytics-debug.apk
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: apk
path: presentation/build/outputs/apk/noAnalytics/debug/QKSMS-noAnalytics-debug.apk
release:
name: Release APK
needs: apk
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download APK from build
uses: actions/download-artifact@v3
with:
name: apk
- name: Create and upload release
uses: softprops/action-gh-release@v1
with:
files: presentation/build/outputs/apk/noAnalytics/debug/QKSMS-noAnalytics-debug.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}