Update build.yaml #24
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 and Release APK | |
on: | |
push: | |
branches: | |
- master # Change this to your main branch | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Regenerate Keystore | |
run: | | |
keytool -genkey -v -keystore /home/runner/work/reactmap-android/reactmap-android/keystore.jks \ | |
-keyalg RSA -keysize 2048 -validity 10000 -alias ${{ secrets.KEY_ALIAS }} \ | |
-storepass ${{ secrets.KEYSTORE_PASSWORD }} -keypass ${{ secrets.KEY_PASSWORD }} \ | |
-dname "CN=Aco, OU=Pogofuerth, O=Pogofuerth, L=DE, ST=BY, C=DE" | |
- name: Check if keystore is available | |
run: ls -a /home/runner/work/reactmap-android/reactmap-android/keystore.jks | |
- name: Make Gradlew executable | |
run: chmod +x ./gradlew | |
- name: Build with Gradle | |
run: ./gradlew assembleRelease | |
- name: Sign APK and create release | |
run: | | |
cd /home/runner/work/reactmap-android/reactmap-android/ | |
./gradlew assembleRelease -Pandroid.injected.signing.store.file=/home/runner/work/reactmap-android/reactmap-android/keystore.jks -Pandroid.injected.signing.store.password=${{ secrets.KEYSTORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.KEY_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.KEY_PASSWORD }} | |
#jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 \ | |
#-keystore keystore.jks \ | |
#-storepass ${{ secrets.KEYSTORE_PASSWORD }} \ | |
#-keypass ${{ secrets.KEY_PASSWORD }} \ | |
#app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.KEY_ALIAS }} | |
- name: List APK directory - apk | |
run: ls -R /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/ | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Reactmap-android | |
path: /home/runner/work/reactmap-android/reactmap-android/app/build/outputs/apk/release/app-release-unsigned.apk |