release-android #19
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: release-android | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Setup Gradle | |
run: chmod +x gradlew | |
- name: Test | |
run: ./gradlew detektAll lintDebug testDebug | |
env: | |
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }} | |
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
API_KEY: ${{ secrets.API_KEY }} | |
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }} | |
- name: Prepare keystore | |
run: | | |
echo "${{ secrets.RELEASE_KEY_STORE }}" >> keystore_base64.txt | |
openssl base64 -d < keystore_base64.txt >> release-keystore-kweather.jks | |
- name: Build Release APK | |
run: ./gradlew aRelease | |
env: | |
RELEASE_STORE_PASSWORD: ${{ secrets.RELEASE_STORE_PASSWORD }} | |
RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} | |
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} | |
API_KEY: ${{ secrets.API_KEY }} | |
MAPBOX_API_KEY: ${{ secrets.MAPBOX_API_KEY }} | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release | |
path: target/android/build/outputs/mapping/ | |
- name: Send mail | |
uses: dawidd6/action-send-mail@v3 | |
with: | |
server_address: ${{ secrets.SERVER_ADDRESS }} | |
server_port: ${{ secrets.SERVER_PORT }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
password: ${{ secrets.SERVER_PASSWORD }} | |
subject: Github Actions job result | |
to: ${{ secrets.EMAIL }} | |
from: Luke Skywalker | |
body: Build job of ${{github.repository}} completed successfully! | |
attachments: ./target/android/build/outputs/apk/release/android-release.apk |