Noti APK Builder #3
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: APK Builder | |
on: | |
workflow_dispatch: | |
jobs: | |
apk: | |
name: Generate APK | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout REPO | |
uses: actions/checkout@v4 | |
with: | |
repository: Burhanverse/Noti | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Setup Keystore | |
env: | |
KEYSTORE: ${{ secrets.KEYSTORE }} | |
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
run: | | |
echo "storePassword=$KEYSTORE_PASSWORD" >> keystore.properties | |
echo "keyAlias=$KEY_ALIAS" >> keystore.properties | |
echo "keyPassword=$KEY_PASSWORD" >> keystore.properties | |
echo "storeFile=${{ github.workspace }}/key.jks" >> keystore.properties | |
echo "$KEYSTORE" | base64 --decode > "${{ github.workspace }}/key.jks" | |
- name: Extract repository name | |
id: extract_repo_name | |
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV | |
- name: Build Release APK | |
run: | | |
./gradlew assembleRelease \ | |
-PKEYSTORE_FILE=${{ github.workspace }}/key.jks \ | |
-PKEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \ | |
-PKEY_ALIAS=${{ secrets.KEY_ALIAS }} \ | |
-PKEY_PASSWORD=${{ secrets.KEY_PASSWORD }} --stacktrace | |
mv ./app/build/outputs/apk/release/app-release.apk "./${{ env.REPO_NAME }}.apk" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.REPO_NAME }}.apk | |
path: ./${{ env.REPO_NAME }}.apk | |
- name: Create and Release APK | |
id: upload_release_asset | |
uses: softprops/[email protected] | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body: Release ${{ env.REPO_NAME }} ${{ github.run_number }} | |
files: ./${{ env.REPO_NAME }}.apk | |
env: | |
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} |