-
Notifications
You must be signed in to change notification settings - Fork 19
161 lines (160 loc) · 5.43 KB
/
release.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
on:
release:
types: [published]
name: Handle Release
jobs:
upload-ios:
name: Upload dsyms
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Set release version and build number env
id: version-format
run: |
version="${github_ref#*v}"
build="${version#*-}"
version="${version%-*}"
build="${build%-*}"
version="${version%-*}"
echo $version
echo $build
echo "::set-output name=version::$version"
echo "::set-output name=build::$build"
env:
github_ref: ${{ github.ref }}
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/cache@v1
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install dependencies
run: yarn
- name: Compile
run: yarn compile
- uses: actions/cache@v1
with:
path: ios/vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: Install fastlane
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
working-directory: ios
- name: Set Release secret
run: |
mkdir -p ios/builds
echo ${{ secrets.APPLE_CONNECT_API_KEY_SECRET }} | base64 -d > ios/builds/AuthKey.p8
- name: Download and update dsyms
run: bundle exec fastlane update_dsyms
working-directory: ios
env:
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_APPLE_PASSWORD }}
APPLE_CONNECT_API_KEY_ID: ${{ secrets.APPLE_CONNECT_API_KEY_ID }}
APPLE_CONNECT_API_ISSUER_ID: ${{ secrets.APPLE_CONNECT_API_ISSUER_ID }}
VERSION_NAME: ${{ steps.version-format.outputs.version }}
BUILD_NUMBER: ${{ steps.version-format.outputs.build }}
build-android:
runs-on: ubuntu-latest
name: Create release-artifacts
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Set up JDK 1.11
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
java-package: jdk
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.10
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install
run: yarn
- name: Compile
run: yarn compile
- name: Setup kernel for react native, increase watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- uses: actions/cache@v1
with:
path: android/vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: Install fastlane
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
working-directory: android
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set Release keystore
run: echo ${{ secrets.ANDROID_RELEASE_KEYSTORE }} | base64 -d > android/app/release.keystore
- name: Set sentry.properties
run: echo ${{ secrets.SENTRY_PROPERTIES }} | base64 -d > android/sentry.properties
- name: Build Release APK
run: bundle exec fastlane apk
working-directory: android
env:
SENTRY_LOAD_DOTENV: 0
ANDROID_RELEASE_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_STORE_PASSWORD }}
ANDROID_RELEASE_KEY_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_KEY_PASSWORD }}
- name: Format release url
id: url-format
run: |
RELEASE_ID=${{ github.event.release.id }}
UPLOAD_URL="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets{?name,label}"
echo "::set-output name=upload_url::$UPLOAD_URL"
- name: Set release version and build number env
id: version-format
run: |
version="${github_ref#*v}"
build="${version#*-}"
version="${version%-*}"
build="${build%-*}"
version="${version%-*}"
echo $version
echo $build
echo "::set-output name=version::$version"
env:
github_ref: ${{ github.ref }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.url-format.outputs.upload_url }}
asset_path: ./android/app/build/outputs/apk/release/app-release.apk
asset_name: liker-land-app_${{ steps.version-format.outputs.version }}.apk
asset_content_type: application/zip