-
Notifications
You must be signed in to change notification settings - Fork 0
180 lines (140 loc) · 5.24 KB
/
release-workflow.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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: release-workflow
on: [push]
# TODO:
# on:
# push:
# branches:
# - release/*
jobs:
# test:
# name: Run tests
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change
# - name: Install gems
# run: bundle install
# - name: Install FVM
# run: curl -fsSL https://fvm.app/install.sh | bash
# - name: Set up FVM
# run: fvm use
# - name: Run virtual machine tests
# run: bundle exec fastlane run_vm_tests
# build_android:
# name: Build Android release
# runs-on: ubuntu-latest
# needs: test
# steps:
# - uses: actions/checkout@v4
# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change
# - name: Install gems
# run: bundle install
# - name: Install FVM
# run: curl -fsSL https://fvm.app/install.sh | bash
# - name: Set up FVM
# run: fvm use
# - name: Decode and save google-services.json
# run: echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 -d > ./android/app/google-services.json
# - name: Decode and save key.properties
# run: echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" | base64 -d > ./android/key.properties
# - name: Decode and save keystore
# run: echo "${{ secrets.COCKTAILR_UPLOAD_KEYSTORE_JKS }}" | base64 -d > ./android/app/cocktailr-upload-keystore.jks
# - name: Set up JDK 17
# uses: actions/setup-java@v4
# with:
# distribution: 'temurin'
# java-version: '17'
# - name: Build release
# run: bundle exec fastlane android build_release
# - name: Upload build artifact
# uses: actions/upload-artifact@v4
# with:
# name: app-release-apk
# path: ./build/app/outputs/flutter-apk/app-release.apk
build_ios:
name: Build iOS release
runs-on: macos-latest
# needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change
- name: Install gems
run: bundle install
- name: Install FVM
run: |
brew tap leoafarias/fvm
brew install fvm
- name: Set up FVM
run: fvm use
- name: Decode and save GoogleServices-Info.plist
run: echo "${{ secrets.GOOGLESERVICE_INFO_PLIST }}" | base64 -d > ./ios/Runner/GoogleService-Info.plist
- name: Decode and save App Store Connect API key
run: echo "${{ secrets.APP_STORE_CONNECT_API_KEY }}" | base64 -d > ./APP_STORE_CONNECT_API_KEY.p8
- name: Set `MATCH_PASSWORD` environment variable
run: echo "MATCH_PASSWORD=${{ secrets.MATCH_PASSWORD }}" >> $GITHUB_ENV
- name: Build release
run: |
echo "${{ secrets.CERTIFICATES_REPO_SSH_KEY }}" > private_key
chmod 600 private_key
ssh-keygen -lf private_key
eval "$(ssh-agent -s)"
ssh-add private_key
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
bundle exec fastlane ios build_release
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: cocktailr-ipa-folder
path: ./build/ios/ipa/cocktailr/
# distribute_android:
# name: Distribute Android release
# runs-on: ubuntu-latest
# needs: build_android
# steps:
# - uses: actions/checkout@v4
# - name: Set up Ruby
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change
# - name: Install gems
# run: bundle install
# - name: Decode and save Firebase App Distribution service account
# run: echo "${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_JSON }}" | base64 -d > ./FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT.json
# - name: Download build artifact
# uses: actions/download-artifact@v4
# with:
# name: app-release-apk
# path: ./build/app/outputs/flutter-apk
# - name: Distribute release
# run: bundle exec fastlane android distribute_firebase
distribute_ios:
name: Distribute iOS release
runs-on: macos-latest
needs: build_ios
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1.1" # TODO: keep this somewhere where it's easy to change
- name: Install gems
run: bundle install
- name: Decode and save Firebase App Distribution service account
run: echo "${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_JSON }}" | base64 -d > ./FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT.json
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: cocktailr-ipa-folder
path: ./build/ios/ipa/
- name: Distribute release
run: bundle exec fastlane ios distribute_firebase