forked from flipperdevices/Flipper-Android-App
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (123 loc) · 4.67 KB
/
internal.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: internal
on:
push:
branches:
- 'dev'
jobs:
build_internal_release:
name: Build Internal AAB and APK
runs-on: ubuntu-latest
outputs:
major_version: ${{ steps.vars.outputs.major_version }}
minor_version: ${{ steps.vars.outputs.minor_version }}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Set up JDK 1.11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Generate build number
id: buildnumber
uses: einaregilsson/build-number@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Set variables'
id: vars
run: |
export $(cat .github/workflows/version.env | xargs)
echo "::set-output name=major_version::${MAJOR_VERSION}"
echo "::set-output name=minor_version::${{ steps.buildnumber.outputs.build_number }}"
- name: Build internal release
run: |
./gradlew :instances:app:assembleInternal :instances:app:bundleInternal \
-Dversion_code=${{ steps.buildnumber.outputs.build_number }} \
-Dversion_name="${{ steps.vars.outputs.major_version }}.${{ steps.vars.outputs.minor_version }}"
- name: Sign AAB
id: sign_aab
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: instances/app/build/outputs/bundle/internal
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_ALIAS_PASSWORD }}
- name: Sign APK
id: sign_apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: instances/app/build/outputs/apk/internal
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_ALIAS_PASSWORD }}
- name: Copy artifacts
id: artifacts_copy
run: |
mkdir artifacts
cp ${{ steps.sign_aab.outputs.signedReleaseFile }} artifacts/flipper-zero.aab
cp ${{ steps.sign_apk.outputs.signedReleaseFile }} artifacts/flipper-zero.apk
cp instances/app/build/outputs/mapping/internal/mapping.txt artifacts/mapping.txt
echo "::set-output name=path::artifacts/"
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: ${{ steps.artifacts_copy.outputs.path }}
upload_to_firebase:
name: Upload to Firebase App Distribution
runs-on: ubuntu-latest
needs: build_internal_release
steps:
- uses: actions/download-artifact@v2
id: download
with:
name: artifacts
- name: Upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
token: ${{ secrets.FIREBASE_TOKEN }}
groups: testers
file: ${{steps.download.outputs.download-path}}/flipper-zero.aab
upload_to_playstore:
name: Upload to Play Store
runs-on: ubuntu-latest
needs: build_internal_release
steps:
- uses: actions/download-artifact@v2
id: download
with:
name: artifacts
- name: Upload to Play Store
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_PUBLISHER_JSON }}
packageName: com.flipperdevices.app
releaseFiles: ${{steps.download.outputs.download-path}}/flipper-zero.aab
track: beta
mappingFile: ${{steps.download.outputs.download-path}}/mapping.txt
upload_to_github:
name: Upload to Github Releases
runs-on: ubuntu-latest
needs: build_internal_release
steps:
- uses: actions/download-artifact@v2
id: download
with:
name: artifacts
- name: Create internal Release
id: create_internal_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
${{steps.download.outputs.download-path}}/flipper-zero.apk
${{steps.download.outputs.download-path}}/mapping.txt
tag_name: ${{ needs.build_internal_release.outputs.major_version }}.${{ needs.build_internal_release.outputs.minor_version }}
name: Flipper App ${{ needs.build_internal_release.outputs.major_version }}.${{ needs.build_internal_release.outputs.minor_version }}
draft: false
prerelease: true