2021-12-09 18:01:20 +00:00
|
|
|
name: Make Release
|
2023-03-03 00:30:53 +00:00
|
|
|
|
2021-12-09 18:01:20 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2023-03-03 00:30:53 +00:00
|
|
|
|
2021-12-09 18:01:20 +00:00
|
|
|
release-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout code
|
2023-09-05 01:07:05 +00:00
|
|
|
uses: actions/checkout@v4
|
2021-12-09 18:01:20 +00:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
|
|
|
|
2024-04-06 10:53:50 +00:00
|
|
|
- name: Get `versionCode` & `versionName`
|
|
|
|
run: |
|
|
|
|
echo "versionCode=$(grep -oP 'versionCode \K\d+' ./app/build.gradle)" >> $GITHUB_ENV
|
|
|
|
echo "versionName=$(grep -oP 'versionName \"\K[^\"]+' ./app/build.gradle)" >> $GITHUB_ENV
|
2023-03-03 00:30:53 +00:00
|
|
|
|
|
|
|
- name: Validate Gradle wrapper
|
2024-04-15 21:18:32 +00:00
|
|
|
uses: gradle/actions/wrapper-validation@v3
|
2023-03-03 00:30:53 +00:00
|
|
|
|
2021-12-09 18:01:20 +00:00
|
|
|
- name: Load secrets
|
|
|
|
run: |
|
|
|
|
rm ./app/google-services.json
|
|
|
|
echo $GSERVICES > ./app/google-services.json
|
|
|
|
echo $KEYSTORE | base64 -di > ./app/$KEYSTORE_FILENAME
|
|
|
|
echo "$KEYSTORE_PROPERTIES" > ./keystore.properties
|
2024-04-06 10:53:50 +00:00
|
|
|
echo -e "versionCode=$versionCode\nversionName=$versionName" > ./version_info.txt
|
2021-12-09 18:01:20 +00:00
|
|
|
env:
|
|
|
|
GSERVICES: ${{ secrets.GSERVICES }}
|
|
|
|
KEYSTORE: ${{ secrets.KEYSTORE }}
|
|
|
|
KEYSTORE_FILENAME: ${{ secrets.KEYSTORE_FILENAME }}
|
|
|
|
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
|
|
|
|
|
2023-06-22 02:12:48 +00:00
|
|
|
- name: Set up JDK 17
|
2023-11-29 23:30:22 +00:00
|
|
|
uses: actions/setup-java@v4
|
2021-12-09 18:01:20 +00:00
|
|
|
with:
|
2023-06-22 02:12:48 +00:00
|
|
|
java-version: '17'
|
2023-03-03 00:30:53 +00:00
|
|
|
distribution: 'zulu'
|
2021-12-09 18:01:20 +00:00
|
|
|
# Note: we don't use caches on release builds because we don't want to accidentally not have a virgin build machine
|
|
|
|
|
2023-01-19 14:24:42 +00:00
|
|
|
- name: Build F-Droid release
|
|
|
|
run: ./gradlew assembleFdroidRelease
|
2022-01-18 21:56:36 +00:00
|
|
|
|
2023-01-19 14:24:42 +00:00
|
|
|
- name: Enable Crashlytics
|
|
|
|
run: sed -i 's/useCrashlytics = false/useCrashlytics = true/g' ./build.gradle
|
|
|
|
|
|
|
|
- name: Build Play Store release
|
|
|
|
run: ./gradlew bundleGoogleRelease assembleGoogleRelease
|
2021-12-09 18:01:20 +00:00
|
|
|
|
|
|
|
- name: Create GitHub release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
id: create_release
|
|
|
|
with:
|
|
|
|
draft: true
|
|
|
|
prerelease: true
|
2023-03-03 00:30:53 +00:00
|
|
|
release_name: Meshtastic Android ${{ env.versionName }} alpha
|
|
|
|
tag_name: ${{ env.versionName }}
|
2021-12-09 18:01:20 +00:00
|
|
|
body: |
|
|
|
|
Autogenerated by github action, developer should edit as required before publishing...
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-01-19 14:24:42 +00:00
|
|
|
- name: Add F-Droid APK to release
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: app/build/outputs/apk/fdroid/release/app-fdroid-release.apk
|
2023-03-03 00:30:53 +00:00
|
|
|
asset_name: fdroidRelease-${{ env.versionName }}.apk
|
2023-01-19 14:24:42 +00:00
|
|
|
asset_content_type: application/zip
|
|
|
|
|
|
|
|
- name: Add Play Store AAB to release
|
2022-01-18 21:56:36 +00:00
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2023-01-19 14:24:42 +00:00
|
|
|
asset_path: app/build/outputs/bundle/googleRelease/app-google-release.aab
|
2023-03-03 00:30:53 +00:00
|
|
|
asset_name: googleRelease-${{ env.versionName }}.aab
|
2022-01-18 21:56:36 +00:00
|
|
|
asset_content_type: application/zip
|
|
|
|
|
2023-01-19 14:24:42 +00:00
|
|
|
- name: Add Play Store APK to release
|
2021-12-09 18:01:20 +00:00
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2023-01-19 14:24:42 +00:00
|
|
|
asset_path: app/build/outputs/apk/google/release/app-google-release.apk
|
2023-03-03 00:30:53 +00:00
|
|
|
asset_name: googleRelease-${{ env.versionName }}.apk
|
2021-12-09 18:01:20 +00:00
|
|
|
asset_content_type: application/zip
|
2024-04-06 10:53:50 +00:00
|
|
|
|
|
|
|
# https://github.com/f-droid/fdroiddata/blob/master/metadata/com.geeksville.mesh.yml#L34
|
|
|
|
- name: Add `version_info.txt` to release
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: version_info.txt
|
|
|
|
asset_name: version_info.txt
|
|
|
|
asset_content_type: text/plain
|