-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitrise.yml
160 lines (148 loc) · 5.17 KB
/
bitrise.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: react-native
workflows:
Setup:
description: |
Get current build number from gradle file.
Increment current build number by 1.
Set incremented build number as $LATEST_BUILD env var.
Update Secrets file with $LATEST_BUILD.
steps:
- script@1:
inputs:
- content: |-
#!/bin/bash
# Setup
set -e
set -o pipefail
set -x
# Get Latest Build Number
echo "$LATEST_BUILD"
INCREMENTED_BUILD_NUMBER=$(($LATEST_BUILD+1))
echo "$INCREMENTED_BUILD_NUMBER"
envman add --key LATEST_BUILD --value "$INCREMENTED_BUILD_NUMBER"
# Define the file path
file=".bitrise.secrets.yml"
# Create a temporary file
temp_file=".bitrise.secrets_temp.yml"
# Copy original line 1 to temp file
head -n 1 "$file" > "$temp_file"
# Write new line 2 to temp file
echo " - LATEST_BUILD: $INCREMENTED_BUILD_NUMBER" >> "$temp_file"
# Skip lines 1-2 and append rest of original file
tail -n +3 "$file" >> "$temp_file"
# Replace the original file with the temporary file
mv "$temp_file" "$file"
- script@1:
inputs:
- content: |-
#!/bin/bash
PROJECT=./ios/jnotes.xcodeproj/project.pbxproj
sed -i '' -e 's/CURRENT_PROJECT_VERSION \= [^\;]*\;/CURRENT_PROJECT_VERSION = '$LATEST_BUILD';/' $PROJECT
build_number=`sed -n '/CURRENT_PROJECT_VERSION/{s/CURRENT_PROJECT_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' $PROJECT`
- file-downloader@1:
inputs:
- destination: android/app/google-services.json
- source: '$BITRISEIO_GOOGLE_SERVICES_JSON_URL'
- activate-ssh-key@4: {}
- git-clone@8: {}
BundleJs:
description:
'Tests, builds and deploys the app using *Deploy to Google Play and
Apple App stores.
'
steps:
- yarn@0.1:
inputs:
- command: ''
- verbose_log: 'yes'
- yarn@0.1:
inputs:
- command: test
- verbose_log: 'yes'
- workdir: '$WORKDIR'
ReleaseAndroid:
description:
'Tests, builds and deploys the app using *Deploy to Google Play.
'
steps:
- install-missing-android-tools@3:
inputs:
- gradlew_path: '$PROJECT_LOCATION/gradlew'
- change-android-versioncode-and-versionname@1:
inputs:
- build_gradle_path: '$PROJECT_LOCATION/$MODULE/build.gradle'
- version_code_offset: '1'
- new_version_name: '$APP_VERSION'
- new_version_code: '$LATEST_BUILD'
- android-build@1:
inputs:
- project_location: '$PROJECT_LOCATION'
- module: '$MODULE'
- build_type: aab
- variant: release
- google-play-deploy@3:
inputs:
- package_name: '$ANDROID_PACKAGE_NAME'
- track: internal
- service_account_json_key_path: '$SERVICE_ACCOUNT_JSON_KEY_PATH'
ReleaseIOS:
description:
'Tests, builds and deploys the app using *Deploy to Apple App Store.
'
steps:
- cocoapods-install@2:
inputs:
- is_cache_disabled: 'true'
- set-xcode-build-number@1:
inputs:
- build_short_version_string: '$APP_VERSION'
- build_version: '$LATEST_BUILD'
- plist_path: ios/jnotes/Info.plist
- xcode-archive@4:
inputs:
- distribution_method: $BITRISE_DISTRIBUTION_METHOD
- automatic_code_signing: api-key
- api_key_path: '$APP_STORE_API_KEY_PATH'
- api_key_id: '$APP_STORE_API_ID'
- api_key_issuer_id: '$APP_STORE_API_ISSUER_ID'
- keychain_path: '$KEYCHAIN_PATH'
- keychain_password: '$KEYCHAIN_PASSWORD'
- certificate_url_list: '$APPLE_IOS_DIST_CERTIFICATE_URL_LIST'
- deploy-to-itunesconnect-application-loader@1:
inputs:
- password: '$APPLE_ID_PASSWORD'
- app_password: '$APP_SPECIFIC_PASSWORD'
- itunescon_user: '$APPLE_ID_EMAIL'
StagingRelease:
before_run: []
after_run:
- Setup
- BundleJs
- ReleaseAndroid
- ReleaseIOS
envs:
- BITRISE_DISTRIBUTION_METHOD: app-store
meta:
bitrise.io:
stack: osx-xcode-14.2.x-ventura
machine_type_id: g2-m1.4core
app:
envs:
- APP_VERSION: '1.4.0'
- BITRISE_PROJECT_PATH: ios/jnotes.xcworkspace
- BITRISE_SCHEME: jnotes
- PROJECT_LOCATION: android
- MODULE: app
- VARIANT: release
- WORKDIR: '.'
- ANDROID_PACKAGE_NAME: com.jnotes
- APPCENTER_CONFIG_JSON_PATH: '$WORKDIR/android/app/src/main/assets'
trigger_map:
- push_branch: main
workflow: StagingRelease
- pull_request_source_branch: '*'
workflow: StagingRelease
pull_request_target_branch: release