-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (104 loc) · 3.82 KB
/
build.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: Build and Deploy
on:
push:
branches:
- initial
jobs:
# ios-build:
# environment: development
# name: iOS development build
# runs-on: [self-hosted, 'macOS']
# steps:
# - name: Cancel previous runs
# uses: styfle/cancel-workflow-action@0.9.1
# - name: Checkout repo from dev branch
# uses: actions/checkout@v3
# with:
# ref: initial
# - name: create-json
# id: add-firebase-credentials
# uses: jsdaniell/create-json@v1.2.2
# with:
# name: 'wildlife-watcher-service-account.json'
# json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
# dir: './fastlane'
# - name: Copy Provisioning certificate
# run: echo -n "${{ secrets.IOS_CERT_PROVISION }}" | base64 --decode > ./fastlane/profile.mobileprovision
# - name: Copy private key
# run: echo -n "${{ secrets.IOS_CERT_PRIVATE_KEY }}" | base64 --decode > ./fastlane/cert.p12
# - name: Copy Google Services plist file
# run: echo -n "${{ secrets.IOS_GOOGLE_SERVICES_PLIST }}" | base64 --decode > ./ios/GoogleService-Info.plist
# - name: Install npm dependency
# run: npm install
# - name: Install bundler
# run: gem install bundler -v 2.4.10
# - name: Install gem plugins
# run: bundle install
# - name: Cache cocoapods
# uses: actions/cache@v3
# with:
# path: /ios/Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
# - name: Install dependencies with CocoaPods
# run: cd ios && bundle exec pod install && cd ..
# - name: Run fastlane
# run: bundle exec fastlane ios build_debug
# env:
# IOS_CERT_PASSWORD: ${{ secrets.IOS_CERT_PASSWORD }}
android-build:
environment: development
name: Android development build
runs-on: ubuntu-latest
container:
image: reactnativecommunity/react-native-android
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Checkout repo from dev branch
uses: actions/checkout@v3
with:
ref: initial
- name: create-json
id: add-firebase-credentials
uses: jsdaniell/create-json@v1.2.2
with:
name: 'wildlife-watcher-service-account.json'
json: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_JSON }}
dir: './fastlane'
- name: create-json
id: add-android-credentials
uses: jsdaniell/create-json@v1.2.2
with:
name: 'google-services.json'
json: ${{ secrets.ANDROID_GOOGLE_SERVICES_JSON }}
dir: './android/app'
- name: Copy keystore file
run: echo -n "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" | base64 --decode > ./keystores/release.keystore
- name: Copy keystore properties file
run: echo -n "${{ secrets.ANDROID_RELEASE_KEYSTORE_PROPS }}" | base64 --decode > ./keystores/release.keystore.properties
- name: Install npm dependency
run: npm install
- name: Install bundler
run: |
gem install bundler -v 2.4.10
- name: Install gem plugins
run: |
bundle install
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run fastlane
run: |
bundle exec fastlane android build_release
env:
APP_VERSION: '0.0.1'
APP_CODE_VERSION: ${{ github.run_id }}
APP_ID: ${{ secrets.APP_ID }}
ANDROID_ARTEFACT_PATH: ${{ secrets.ANDROID_ARTEFACT_PATH }}