-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (112 loc) · 4.39 KB
/
build-android.yml
File metadata and controls
139 lines (112 loc) · 4.39 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Build / Android
on: workflow_dispatch
permissions:
contents: read
defaults:
run:
shell: bash
# env:
# CI: ''
# SKIP_SIGNING: true
jobs:
build-mobile:
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
matrix:
os: [macos-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v3
# Set Current Date As Env Variable
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '21'
cache: 'gradle'
- name: Change wrapper permissions
working-directory: ./android
run: chmod +x ./gradlew
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 20
- name: Set npm version
run: npm install -g npm@10
- name: Authenticate with fontawesome NPM repo
run: |
echo "pwd=${PWD}"
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ${{ secrets.FONT_AWESOME_AUTH_TOKEN }}
- name: Create .env file
run: echo "${{ secrets.ENV_FILE }}" > .env
- name: Install root dependencies
run: npm install
- name: Install the Android supporting files
working-directory: ./android
env:
ANDROID_KEY_PROPERTIES: ${{ secrets.ANDROID_KEY_PROPERTIES }}
ANDROID_UPLOAD_KEY_JKS: ${{ secrets.ANDROID_UPLOAD_KEY_JKS }}
run: |
# create variables
KEY_PROPERTIES_FILE=./key.properties
UPLOAD_KEY_JKS_FILE=./androiduploadkey.jks
# create files
echo -n "$ANDROID_KEY_PROPERTIES" | base64 --decode -o $KEY_PROPERTIES_FILE
echo -n "$ANDROID_UPLOAD_KEY_JKS" | base64 --decode -o $UPLOAD_KEY_JKS_FILE
- name: npm build-mobile
run: npm run build-mobile
# outputs to:
# ./app/build/outputs/apk/release/app-release.apk
# ./app/build/outputs/apk/debug/app-debug.apk
- name: Build Project
working-directory: ./android
run: ./gradlew build
# - name: Assemble APK Debug
# working-directory: ./android
# run: ./gradlew assembleDebug
# - name: Build APK Release
# working-directory: ./android
# run: ./gradlew assemble
# Create Bundle AAB Release
# outputs to:
# ./app/build/intermediates/intermediary_bundle/release/intermediary-bundle.aab
# ./app/build/outputs/bundle/release/app-release.aab
- name: Build App Bundle
working-directory: ./android
run: ./gradlew bundleRelease
# Upload Bundle AAB Release
# - name: Upload AAB (App Bundle) Release
# uses: actions/upload-artifact@v4
# with:
# name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - App bundle(s) AAB release generated
# path: ${{ env.main_project_module }}/build/outputs/bundle/release/
# - name: Create Release
# id: create_release
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ github.event.inputs.version }}
# name: Release v${{ github.event.inputs.version }}
# draft: true
# prerelease: false
# files: <<application name>>/<<application name>>_${{ github.event.inputs.version }}.apk
- name : Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.remoteit
releaseFiles: ./android/app/build/outputs/bundle/release/app-release.aab
track: internal
status: completed
inAppUpdatePriority: 0
# whatsNewDirectory: distribution/whatsnew
# mappingFile: app/build/outputs/mapping/release/mapping.txt
# debugSymbols: app/build/intermediates/merged_native_libs/release/out/lib/