-
-
Notifications
You must be signed in to change notification settings - Fork 224
106 lines (90 loc) · 3.69 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Make Release
on:
workflow_dispatch:
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- 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
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- 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
echo -e "versionCode=$versionCode\nversionName=$versionName" > ./version_info.txt
env:
GSERVICES: ${{ secrets.GSERVICES }}
KEYSTORE: ${{ secrets.KEYSTORE }}
KEYSTORE_FILENAME: ${{ secrets.KEYSTORE_FILENAME }}
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
# Note: we don't use caches on release builds because we don't want to accidentally not have a virgin build machine
- name: Build F-Droid release
run: ./gradlew assembleFdroidRelease
- name: Enable Crashlytics
run: sed -i 's/useCrashlytics = false/useCrashlytics = true/g' ./build.gradle
- name: Build Play Store release
run: ./gradlew bundleGoogleRelease assembleGoogleRelease
- name: Create GitHub release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: true
release_name: Meshtastic Android ${{ env.versionName }} alpha
tag_name: ${{ env.versionName }}
body: |
Autogenerated by github action, developer should edit as required before publishing...
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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
asset_name: fdroidRelease-${{ env.versionName }}.apk
asset_content_type: application/zip
- name: Add Play Store AAB 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/bundle/googleRelease/app-google-release.aab
asset_name: googleRelease-${{ env.versionName }}.aab
asset_content_type: application/zip
- name: Add Play Store 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/google/release/app-google-release.apk
asset_name: googleRelease-${{ env.versionName }}.apk
asset_content_type: application/zip
# 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