Skip to content
name: Build, Sign Release App, and Upload To Google Play
on:
release:
types: released
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Access OPEN_WEATHER_API_KEY and MAPS_API_KEY
env:
OPEN_WEATHER_API_KEY: ${{ secrets.OPEN_WEATHER_API_KEY }}
MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
run: |
echo OPEN_WEATHER_API_KEY=\"$OPEN_WEATHER_API_KEY\" >> ./local.properties
echo MAPS_API_KEY=\"$MAPS_API_KEY\" >> ./local.properties
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: assemble release
run: ./gradlew assembleRelease
- name: Sign Release
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.KEYSTORE }}
alias: ${{ secrets.SIGNING_KEY_ALIAS }}
keyStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: Build Artifacts
path: app/build/outputs/
- name: Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.camp.campingtripplanner
releaseFiles: app/build/outputs/apk/release/app-release-unsigned-signed.apk
track: production