-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (70 loc) · 2.5 KB
/
deploy-native-android.yml
File metadata and controls
80 lines (70 loc) · 2.5 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
name: 🚀 Deploy Android
on:
workflow_run:
workflows:
- '🤖 Android Build'
types:
- completed
permissions:
contents: read
deployments: write
concurrency:
group: deploy-android-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false
jobs:
deploy:
name: Submit Android artifact
if: >
github.event.workflow_run.conclusion == 'success' &&
(github.event.workflow_run.event == 'push' || github.event.workflow_run.event == 'workflow_dispatch') &&
(github.event.workflow_run.head_branch == 'main' ||
github.event.workflow_run.head_branch == 'staging' ||
github.event.workflow_run.head_branch == 'test')
runs-on: ubuntu-latest
environment: ${{ github.event.workflow_run.head_branch == 'main' && 'production' || github.event.workflow_run.head_branch == 'staging' && 'staging' || 'test' }}
timeout-minutes: 45
env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v5
with:
ref: ${{ github.event.workflow_run.head_sha }}
fetch-depth: 0
- name: 🚧 Setup workspace
uses: ./.github/actions/setup
- name: ⬇️ Download preview artifact
continue-on-error: true
uses: actions/download-artifact@v5
with:
name: native-android-preview
run-id: ${{ github.event.workflow_run.id }}
path: artifacts-preview
- name: ⬇️ Download production artifact
continue-on-error: true
uses: actions/download-artifact@v5
with:
name: native-android-production
run-id: ${{ github.event.workflow_run.id }}
path: artifacts-production
- name: 📦 Extract artifacts
id: extract
shell: bash
run: |
set -euo pipefail
shopt -s nullglob
files=(artifacts-*/native-android-*.tar.gz)
if (( ${#files[@]} == 0 )); then
echo "found=false" >> "$GITHUB_OUTPUT"
exit 0
fi
for file in "${files[@]}"; do
tar -xzf "$file"
done
echo "found=true" >> "$GITHUB_OUTPUT"
- name: 🚀 Submit to Google Play
if: steps.extract.outputs.found == 'true'
run: tsx scripts/run-ci-stage.ts --stage deploy-native-android
- name: ℹ️ No artifacts to deploy
if: steps.extract.outputs.found != 'true'
run: echo "No Android artifacts were available for run ${{ github.event.workflow_run.id }}."