-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (143 loc) · 5.5 KB
/
release-prod-app.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
name: Release production
on:
workflow_dispatch:
pull_request:
branches:
- main
types: [closed]
env:
BUILD_NUMBER: ${{ github.run_number }}
# Used by https://github.com/Microsoft/fastlane-plugin-appcenter
APPCENTER_API_TOKEN: ${{ secrets.APPCENTER_API_TOKEN }}
APPCENTER_OWNER_NAME: ${{ secrets.APPCENTER_OWNER_NAME }}
APPCENTER_OWNER_TYPE: ${{ secrets.APPCENTER_OWNER_TYPE }}
jobs:
release_prod_ios:
env:
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APP_PASSWORD }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
name: iOS (production)
environment: production
runs-on: macos-14
if:
github.event_name == 'workflow_dispatch' || (startsWith(github.head_ref, 'release/') && github.event.pull_request.merged ==
true)
steps:
- name: Notarize Release Build
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- uses: actions/checkout@v3
- uses: nyaa8/package-version@v1
name: Fetch current version
- name: Create .env file
run: |
touch .env
echo NODE_ENV=production >> .env
echo REACT_NATIVE_APP_AUTH0_DOMAIN="${{ secrets.AUTH0_DOMAIN }}" >> .env
echo REACT_NATIVE_APP_AUTH0_AUDIENCE="${{ secrets.AUTH0_AUDIENCE }}" >> .env
echo REACT_NATIVE_APP_AUTH0_SCHEME="${{ secrets.AUTH0_SCHEME }}" >> .env
echo REACT_NATIVE_APP_AUTH0_CLIENT_ID="${{ secrets.AUTH0_CLIENT_ID }}" >> .env
echo REACT_NATIVE_APP_ENCRYPTION_KEY="${{ secrets.ENCRYPTION_KEY }}" >> .env
echo API_HOST="${{ secrets.API_HOST }}" >> .env
echo API_HOST_UITDATABANK="${{ secrets.API_HOST_UITDATABANK }}" >> .env
echo APP_NAME="${{ secrets.APP_NAME }}" >> .env
echo SENTRY_DSN="${{ secrets.SENTRY_DSN }}" >> .env
echo REACT_NATIVE_APP_VERSION_NR="${{ env.PACKAGE_VERSION }}" >> .env
cat .env
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Restore Pods cache
uses: actions/cache@v3
with:
path: |
ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install pods
run: cd ios && pod install
- run: fastlane ios_prod
release_prod_android:
name: Android (prod)
environment: production
runs-on: macos-14
if:
github.event_name == 'workflow_dispatch' || (startsWith(github.head_ref, 'release/') && github.event.pull_request.merged ==
true)
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.BRANCH }}
- uses: nyaa8/package-version@v1
name: Fetch current version
- name: Create .env file
run: |
touch .env
echo NODE_ENV=production >> .env
echo REACT_NATIVE_APP_AUTH0_DOMAIN="${{ secrets.AUTH0_DOMAIN }}" >> .env
echo REACT_NATIVE_APP_AUTH0_AUDIENCE="${{ secrets.AUTH0_AUDIENCE }}" >> .env
echo REACT_NATIVE_APP_AUTH0_SCHEME="${{ secrets.AUTH0_SCHEME }}" >> .env
echo REACT_NATIVE_APP_AUTH0_CLIENT_ID="${{ secrets.AUTH0_CLIENT_ID }}" >> .env
echo REACT_NATIVE_APP_ENCRYPTION_KEY="${{ secrets.ENCRYPTION_KEY }}" >> .env
echo API_HOST="${{ secrets.API_HOST }}" >> .env
echo API_HOST_UITDATABANK="${{ secrets.API_HOST_UITDATABANK }}" >> .env
echo APP_NAME="${{ secrets.APP_NAME }}" >> .env
echo SENTRY_DSN="${{ secrets.SENTRY_DSN }}" >> .env
echo REACT_NATIVE_APP_VERSION_NR="${{ env.PACKAGE_VERSION }}" >> .env
cat .env
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: gradle
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Decode Service Account Key JSON File
uses: timheuer/base64-to-file@v1
id: service_account_json_file
with:
fileName: 'uitpas-store-api.json'
encodedString: ${{ secrets.GPLAY_SERVICE_ACCOUNT_KEY_JSON }}
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: 'uitpas.keystore'
encodedString: ${{ secrets.STORE_FILE }}
- run: fastlane android_prod
env:
STORE_FILE: ${{ steps.android_keystore.outputs.filePath }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }}
create_release:
name: Create release
needs: [release_prod_ios, release_prod_android]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.BRANCH }}
- uses: nyaa8/package-version@v1
name: Fetch current version
- name: Run latest-tag
uses: EndBug/latest-tag@latest
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.PACKAGE_VERSION }}