-
Notifications
You must be signed in to change notification settings - Fork 11
120 lines (99 loc) · 3.64 KB
/
deploy-android.yaml
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
name: Deploy Android
on:
push:
branches:
- develop
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 45
env:
TZ: Asia/Tokyo
LANG: ja_JP.UTF-8
steps:
# https://github.com/actions/checkout/tree/v4/
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- name: Setup Application Runtime
uses: ./.github/actions/setup-application-runtime
# Certificateを取得するために、Deploy Keyを設定
- name: Set up ssh key
run: |
mkdir -p ~/.ssh/
echo "${{ secrets.SSH_ID_ED25519 }}" | base64 -d > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
eval $(ssh-agent -s)
echo "Host github.com \n\tIdentityFile ~/.ssh/id_ed25519\n\tUser git\n\tIdentityiesOnly yes" >> ~/.ssh/config
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- name: Pre set up ruby
run: cp .ruby-version app/android/.ruby-version
- name: Set up ruby
# https://github.com/ruby/setup-ruby/tree/v1/
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984
with:
bundler-cache: true
working-directory: app/android
# https://github.com/actions/setup-java/tree/v4/
- uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
with:
distribution: "oracle"
java-version: "17"
- name: Set Google Play Service Account
run: |
echo '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}' | base64 -d > app/android/eqmonitor-main-4325501acd45.json
- name: Set .env
working-directory: app
run: echo '${{ secrets.ENV}}' | base64 -d > .env
- name: Regenerate code
working-directory: app
run: dart run build_runner build --delete-conflicting-outputs
- name: Extract keystore
run: |
echo '${{ secrets.SIGNING_KEY }}' | base64 -d > app/android/app/key.jks
echo '${{ secrets.FIREBASE_ANDROID }}' | base64 -d > app/android/app/google-services.json
echo '${{ secrets.KEY_PROPERTIES }}' | base64 -d > app/android/key.properties
- name: Build AAB
working-directory: app/android
run: bundle exec fastlane build
- name: Upload artifact aab
uses: actions/[email protected]
with:
path: app/build/app/outputs/bundle/release/app-release.aab
name: release-aab
deploy:
runs-on: ubuntu-latest
needs: build
steps:
# https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch all history for all tags and branches
fetch-depth: 0
- name: Download artifact aab
uses: actions/download-artifact@v4
with:
name: release-aab
path: app/android/output
- name: Move aab
working-directory: app/android
run: mv output/app-release.aab output.aab
- name: Pre set up ruby
run: cp .ruby-version app/android/.ruby-version
- name: Set up ruby
# https://github.com/ruby/setup-ruby/tree/v1/
uses: ruby/setup-ruby@f26937343756480a8cb3ae1f623b9c8d89ed6984
with:
bundler-cache: true
working-directory: app/android
- name: Set Google Play Service Account
run: |
echo '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}' | base64 -d > app/android/eqmonitor-main-4325501acd45.json
- name: Upload
working-directory: app/android
run: bundle exec fastlane upload