Repository navigation
137 lines (119 loc) · 4.64 KB
/
Copy pathbuild-android.yml
File metadata and controls
137 lines (119 loc) · 4.64 KB
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
name: Build Android And Upload
on:
workflow_call:
inputs:
trigger:
type: string
required: false
default: pr
permissions: {}
jobs:
build-hold:
name: Hold
runs-on: ubuntu-latest
permissions: {}
if: ${{ inputs.trigger == 'pr' }}
environment: android_build
steps:
- run: echo "Waiting for manual approval..."
build-android:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
needs: build-hold
if: ${{ always() && (needs.build-hold.result == 'success' || needs.build-hold.result == 'skipped') }}
outputs:
BUILD_VERSION: ${{ steps.version.outputs.BUILD_VERSION }}
steps:
- name: Checkout Repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- parallel:
- name: Checkout and Setup Node
uses: ./.github/actions/setup-node
- name: Set up Ruby and Bundler
uses: ruby/setup-ruby@7372622e62b60b3cb750dcd2b9e32c247ffec26a # v1.302.0
with:
ruby-version: 2.7.7
bundler-cache: true
working-directory: android
- name: Set up Gradle
uses: gradle/actions/setup-gradle@ed408507eac070d1f99cc633dbcf757c94c7933a # v4.4.3
- name: Fetch supported versions from Cloud
uses: ./.github/actions/fetch-supported-versions
with:
build_name: 'android'
- name: Generate Build Version
id: version
uses: ./.github/actions/generate-build-version
with:
RN_VARIABLES_PAT: ${{ secrets.RN_VARIABLES_PAT }}
- name: Build Android
uses: ./.github/actions/build-android
timeout-minutes: 60
with:
GOOGLE_SERVICES_ANDROID: ${{ secrets.GOOGLE_SERVICES_ANDROID }}
KEYSTORE_OFFICIAL_BASE64: ${{ secrets.KEYSTORE_OFFICIAL_BASE64 }}
KEYSTORE_OFFICIAL: ${{ secrets.KEYSTORE_OFFICIAL }}
KEYSTORE_OFFICIAL_PASSWORD: ${{ secrets.KEYSTORE_OFFICIAL_PASSWORD }}
KEYSTORE_OFFICIAL_ALIAS: ${{ secrets.KEYSTORE_OFFICIAL_ALIAS }}
BUGSNAG_KEY_OFFICIAL: ${{ secrets.BUGSNAG_KEY_OFFICIAL }}
BUILD_VERSION: ${{ steps.version.outputs.BUILD_VERSION }}
- parallel:
- name: Upload sourcemaps/NDK symbols to Bugsnag
run: |
pnpm bugsnag:upload-android --variant release --app-manifest android/app/build/intermediates/merged_manifests/release/processReleaseManifest/AndroidManifest.xml
pnpm exec bugsnag-cli upload android-aab android/app/build/outputs/bundle/release/app-release.aab
- name: Upload AAB
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: android-aab
path: android/app/build/outputs/bundle/release/app-release.aab
upload-hold:
name: Upload Hold
runs-on: ubuntu-latest
permissions: {}
if: ${{ inputs.trigger == 'pr' }}
environment: upload_android
needs: [build-android]
outputs:
BUILD_VERSION: ${{ needs.build-android.outputs.BUILD_VERSION }}
steps:
- run: echo "Waiting for manual approval..."
upload-android:
name: Upload
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
needs: [build-android, upload-hold]
if: ${{ always() && needs.build-android.result == 'success' && (needs.upload-hold.result == 'success' || needs.upload-hold.result == 'skipped') }}
steps:
- name: Checkout Repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Upload Android
uses: ./.github/actions/upload-android
with:
trigger: ${{ inputs.trigger }}
FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_VERSION: ${{ needs.build-android.outputs.BUILD_VERSION }}
upload-internal:
name: Internal Sharing
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
needs: [build-android]
if: ${{ inputs.trigger == 'pr' }}
steps:
- name: Checkout Repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Checkout and Setup Node
uses: ./.github/actions/setup-node
- name: Upload Internal Sharing
uses: ./.github/actions/upload-internal-android
with:
FASTLANE_GOOGLE_SERVICE_ACCOUNT: ${{ secrets.FASTLANE_GOOGLE_SERVICE_ACCOUNT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_VERSION: ${{ needs.build-android.outputs.BUILD_VERSION }}