Skip to content

Commit 40c2858

Browse files
committed
update github action
1 parent 30c4150 commit 40c2858

File tree

5 files changed

+105
-41
lines changed

5 files changed

+105
-41
lines changed

Diff for: .github/actions/build_android/action.yml

+41-25
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,49 @@ runs:
55
using: 'composite'
66

77
steps:
8-
- name: Set up JDK
9-
uses: actions/setup-java@v3
10-
with:
11-
distribution: 'temurin'
12-
java-version: 17
13-
14-
- name: Set up Ruby
15-
uses: ruby/setup-ruby@v1
16-
with:
17-
ruby-version: '2.7'
18-
19-
- name: Install Fastlane
20-
run: gem install fastlane
8+
- name: Retrieve the secrets and decode it to a file
9+
run: |
10+
echo $UPLOAD_KEYSTORE_BASE64 | base64 --decode > android/keystore/upload.keystore
11+
echo $PLAY_STORE_CREDENTIALS_BASE64 | base64 --decode > android/fastlane/play-store-credentials.json
12+
mv android/keystore/upload.keystore ${{ github.workspace }}/artifacts/android/upload.keystore
13+
mv android/fastlane/play-store-credentials.json ${{ github.workspace }}/artifacts/android/play-store-credentials.json
2114
shell: bash
2215

23-
- name: Setup Node
24-
uses: actions/setup-node@v3
25-
with:
26-
node-version-file: .nvmrc
27-
28-
- name: Build Android Library with Fastlane
29-
run: cd android && fastlane android local
30-
shell: bash
31-
32-
- name: Copy Android Library to Shared Directory
33-
run: mkdir -p ${{ github.workspace }}/artifacts/android && cp ./artifacts/app-production-debug.apk ${{ github.workspace }}/artifacts/android/app-production-debug.apk
34-
shell: bash
16+
# - name: Set up JDK
17+
# uses: actions/setup-java@v3
18+
# with:
19+
# distribution: 'temurin'
20+
# java-version: 17
21+
22+
# - name: Set up Ruby
23+
# uses: ruby/setup-ruby@v1
24+
# with:
25+
# ruby-version: '2.7'
26+
27+
# - name: Install Fastlane
28+
# run: gem install fastlane
29+
# shell: bash
30+
31+
# - name: Setup Node
32+
# uses: actions/setup-node@v3
33+
# with:
34+
# node-version-file: .nvmrc
35+
36+
# - name: Build Android Library with Fastlane
37+
# run: cd android && fastlane android local
38+
# shell: bash
39+
# env:
40+
# FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
41+
# ANDROID_KEYSTORE_PATH: ${{ env.ANDROID_KEYSTORE_PATH }}
42+
# ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
43+
# ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
44+
# ANDROID_KEYSTORE_KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }}
45+
46+
# - name: Copy Android Library to Shared Directory
47+
# run: |
48+
# mkdir -p ${{ github.workspace }}/artifacts/android
49+
# cp ./artifacts/app-production-debug.apk ${{ github.workspace }}/artifacts/android/app-production-debug.apk
50+
# shell: bash
3551

3652
- name: Upload apk to artifact
3753
uses: actions/upload-artifact@v4

Diff for: .github/workflows/BuildAndroid.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Build Android"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Retrieve the secrets and decode it to a file
20+
run: |
21+
ls android
22+
echo U0VMQU0= | base64 --decode > ./android/test.txt
23+
echo $UPLOAD_KEYSTORE_BASE64 | base64 --decode > ./android/keystores/upload.keystore
24+
echo $PLAY_STORE_CREDENTIALS_BASE64 | base64 --decode > ./android/fastlane/play-store-credentials.json
25+
shell: bash
26+
27+
- name: Upload apk to artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: android
31+
path: ./android/

Diff for: .github/workflows/test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ jobs:
1818

1919
- name: Build Android apk
2020
uses: ./.github/actions/build_android
21+
env:
22+
UPLOAD_KEYSTORE_BASE64: ${{ secrets.UPLOAD_KEYSTORE_BASE64 }}
23+
PLAY_STORE_CREDENTIALS_BASE64: ${{ secrets.PLAY_STORE_CREDENTIALS_BASE64 }}

Diff for: android/app/google-services.json

+26-8
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,47 @@
11
{
22
"project_info": {
3-
"project_number": "788164346630",
4-
"project_id": "make-it-native-test",
5-
"storage_bucket": "make-it-native-test.appspot.com"
3+
"project_number": "542084943474",
4+
"firebase_url": "https://mendix-developerapp.firebaseio.com",
5+
"project_id": "mendix-developerapp",
6+
"storage_bucket": "mendix-developerapp.appspot.com"
67
},
78
"client": [
89
{
910
"client_info": {
10-
"mobilesdk_app_id": "1:788164346630:android:8abda4292fe590982d1487",
11+
"mobilesdk_app_id": "1:542084943474:android:2ca19794e96659b1da7ceb",
1112
"android_client_info": {
1213
"package_name": "com.mendix.developerapp.mx10"
1314
}
1415
},
15-
"oauth_client": [],
16+
"oauth_client": [
17+
{
18+
"client_id": "542084943474-kuqtb0msdmjroc74mf9t9oui5if4046i.apps.googleusercontent.com",
19+
"client_type": 3
20+
}
21+
],
1622
"api_key": [
1723
{
18-
"current_key": "AIzaSyD3pLyuEY38P44jR1hHYr00qKwOL_kJm_k"
24+
"current_key": "{{firebase-api-key}}"
1925
}
2026
],
2127
"services": {
2228
"appinvite_service": {
23-
"other_platform_oauth_client": []
29+
"other_platform_oauth_client": [
30+
{
31+
"client_id": "542084943474-kuqtb0msdmjroc74mf9t9oui5if4046i.apps.googleusercontent.com",
32+
"client_type": 3
33+
},
34+
{
35+
"client_id": "542084943474-03rk9m3agr20fs8fnjg4if2kosog0iil.apps.googleusercontent.com",
36+
"client_type": 2,
37+
"ios_info": {
38+
"bundle_id": "com.mendix.developerapp.native.mx10"
39+
}
40+
}
41+
]
2442
}
2543
}
2644
}
2745
],
2846
"configuration_version": "1"
29-
}
47+
}

Diff for: android/fastlane/Fastfile

+4-8
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@
66

77
default_platform(:android)
88

9-
ENV["GRADLE_BINTRAY_REPO"] = ENV["NEXUS_BINTRAY_PROXY_URL"]
10-
ENV["GRADLE_JITPACK_REPO"] = ENV["NEXUS_JITPACK_PROXY_URL"]
11-
129
GOOGLE_PLAY_VERSION = sh("node -p -e \"require('../../package.json')['store-versions']['google-play']\"").chomp
1310
BUILD_NUMBER = ENV["BUILD_NUMBER"]
11+
TEST = ENV["TEST"]
1412
ORIGINAL_CHANGELOG_PATH = "../../CHANGELOG.android.txt"
1513
FASTLANE_CHANGELOG_PATH = "./metadata/android/en-US/changelogs/default.txt"
1614
versionCodeOffset = 304
1715

1816
platform :android do
1917
before_all do
2018
Dir.chdir("../..") do
21-
sh("npm", "ci", "--legacy-peer-deps")
19+
sh("npm", "ci")
2220
# Special hack to work-around alpine linux problem - File.getCanonicalPath is failing without a reason:
2321
sh("find node_modules -name '*.gradle' -type f -exec sed -i.bak '/canonicalPath/d' {} +")
2422
end
@@ -74,10 +72,8 @@ platform :android do
7472

7573
UI.message "Replacing Firebase API keys from environment variables"
7674
Dir.chdir("../app") do
77-
firebaseApiKey1 = ENV["FIREBASE_API_KEY_1"] || "FIREBASE_API_KEY_1"
78-
sh("sed -i 's/{{firebase-api-key-1}}/#{firebaseApiKey1}/g' google-services.json")
79-
firebaseApiKey2 = ENV["FIREBASE_API_KEY_2"] || "FIREBASE_API_KEY_2"
80-
sh("sed -i 's/{{firebase-api-key-2}}/#{firebaseApiKey2}/g' google-services.json")
75+
firebaseApiKey = ENV["FIREBASE_API_KEY"] || "FIREBASE_API_KEY"
76+
sh("sed -i 's/{{firebase-api-key}}/#{firebaseApiKey}/g' google-services.json")
8177
end
8278

8379
if options[:submit] == true

0 commit comments

Comments
 (0)