-
Notifications
You must be signed in to change notification settings - Fork 2
152 lines (136 loc) · 4.2 KB
/
latest.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# This is workflow to build Android app for testing
name: The latest Android build from main-branch
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
# Build job needs test !
jobs:
# Run React Native Eslint and Jest tests
test:
if: ${{ false }}
name: Test
# Setup Ubuntu version
runs-on: ubuntu-latest
strategy:
# Node version matrix
matrix:
node-version: [20.11.1]
# Steps
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
# Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
# Install dependencies
- name: Install dependencies
run: yarn install
# Get defaultConfig
- name: Get defaultConfig
env:
defaultConfig: ${{ secrets.DEFAULTCONFIG }}
shell: bash
run: |
touch defaultConfig.ts
echo "$defaultConfig" >> defaultConfig.ts
# Run lint -tests
- name: Run Eslint tests
if: ${{ false }}
run: yarn lint --fix
# Run Jest -tests
- name: Run Jest tests
if: ${{ false }}
run: yarn test
# Decode, Build and sign Android application
build:
# needs: test
name: Android-build
# Set Ubuntu version
runs-on: ubuntu-latest
# Node version matrix
strategy:
matrix:
node-version: [20.11.1]
# Steps
steps:
- name: Checkout to git repository
uses: actions/checkout@v4
# Setup Node
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: |
yarn install
# Get defaultConfig
- name: Get defaultConfig
env:
defaultConfig: ${{ secrets.DEFAULTCONFIG }}
shell: bash
run: |
touch defaultConfig.ts
echo "$defaultConfig" >> defaultConfig.ts
# Get widgetConfig
- name: Get widgetConfig
env:
widgetConfig: ${{ secrets.WIDGETCONFIG }}
shell: bash
run: |
touch widgetConfig.json
echo "$widgetConfig" >> widgetConfig.json
# Set up Java 17
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin' # You can use 'adopt', 'zulu', or another distribution if needed
# Install Ruby
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.0'
# Update bundler
- name: Update bundler
run: bundle update --bundler
working-directory: android
# Bundle install
- name: Bundle install
run: gem install bundler && bundle install
working-directory: android
# Decode upload keystore
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: "android_keystore.keystore"
encodedString: ${{ secrets.KEYSTORE }}
# Build and sign
- name: Build
env:
KEYSTORE: ${{ steps.android_keystore.outputs.filePath }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
# SLACK_WEB_HOOK_URL: ${{ secrets.SLACK_WEB_HOOK_URL }}
run: |
echo "GOOGLE_MAPS_API_KEY=${{ secrets.GOOGLE_MAPS_API_KEY }}" > .env
chmod +x ./gradlew
bundle exec fastlane android build_test_apk
working-directory: android
# Upload artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: app-latest.apk
path: |
${{ github.workspace }}/android/app/build/outputs/apk/latest/app-latest.apk
retention-days: 7
overwrite: true