Workflow file for this run
This file contains hidden or 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, Sign Release App, and Upload To Google Play | |
| # Triggers when a release is created on Github | |
| on: | |
| release: | |
| types: released | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| 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: Setup build tool version variable | |
| shell: bash | |
| run: | | |
| BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) | |
| echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV | |
| echo Last build tool version is: $BUILD_TOOL_VERSION | |
| - 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 }} | |
| env: | |
| BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| 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 |