Skip to content

Merge branch 'main' of github.com:manununhez/purrfect-pics into relea… #12

Merge branch 'main' of github.com:manununhez/purrfect-pics into relea…

Merge branch 'main' of github.com:manununhez/purrfect-pics into relea… #12

Workflow file for this run

name: Generate release APK and AAB
on:
push:
branches: [ "release/*/*" ]
jobs:
apk:
name: Generate release builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Decode keystore and create jks
run: echo "${{ secrets.KEY_KEYSTORE_BASE64 }}" | base64 --decode > app/keystore.jks
- name: Generate keystore.properties
run: |
cat <<EOF > keystore.properties
PEXELS_API_KEY=${{ secrets.PEXELS_API_KEY }}
KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}
KEY_ALIAS=${{ secrets.KEY_ALIAS }}
KEYSTORE_FILE=${{ secrets.KEYSTORE_FILE }}
EOF
- name: Generate file name env var
run: |
DATE=$(date +'%d.%m.%Y')
BRANCH_NAME=${GITHUB_REF##*/}
MESSAGE=$(cat << EOF
PurrfectPics-release-${BRANCH_NAME}-${DATE}
EOF)
echo OUTPUT_NAME=$MESSAGE >> $GITHUB_ENV
- name: Build release APK
run: bash ./gradlew assembleRelease --stacktrace
- name: Rename APK
run:
mv "./app/build/outputs/apk/release/app-release.apk" "./app/build/outputs/apk/release/${{ env.OUTPUT_NAME }}.apk"
- name: Upload release APK
uses: actions/upload-artifact@v1
with:
name: ${{ env.OUTPUT_NAME }}
path: app/build/outputs/apk/release/${{ env.OUTPUT_NAME }}.apk
- name: Build release AAB
run: bash ./gradlew bundleRelease --stacktrace
- name: Rename AAB
run:
mv "./app/build/outputs/bundle/release/app-release.aab" "./app/build/outputs/bundle/release/${{ env.OUTPUT_NAME }}.aab"
- name: Upload debug AAB
uses: actions/upload-artifact@v1
with:
name: ${{ env.OUTPUT_NAME }}
path: app/build/outputs/bundle/release/${{ env.OUTPUT_NAME }}.aab