Repository navigation
111 lines (96 loc) · 3.64 KB
/
Copy pathdeploy-expo-update.yml
File metadata and controls
111 lines (96 loc) · 3.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
name: Deploy Expo Update
on:
workflow_dispatch:
inputs:
sha:
description: "Commit SHA to publish"
required: true
type: string
deployment:
description: "Channel to publish to"
required: true
type: choice
options:
- canary
- staging
- production
platform:
description: "Platform(s) to publish"
required: false
type: choice
default: all
options:
- all
- ios
- android
description:
description: "Update description (defaults to the commit subject if left blank)"
required: false
type: string
rollout_percentage:
description: "Rollout percentage (0-100). Leave blank for a full rollout."
required: false
type: string
check_against_version:
description: "Compare against this app version's shipped fingerprint instead of main's latest"
required: false
type: boolean
default: false
run-name: "Deploy Expo Update to ${{ inputs.deployment }} on ${{ case(inputs.platform == 'all', 'both platforms', inputs.platform) }} · ${{ inputs.sha }}"
# example: Deploy Expo Update to production on android · SHA
permissions:
contents: write # needed for tag_and_push (fastlane/utility_fastlane.rb)
concurrency:
group: deploy-expo-update-${{ inputs.deployment }}
cancel-in-progress: false
jobs:
deploy:
runs-on: macos-26
timeout-minutes: 30
steps:
- name: Checkout repository at the published commit
uses: actions/checkout@v5
with:
ref: ${{ inputs.sha }}
- name: Setup repository environment
uses: ./.github/actions/setup-repo-environment
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Setup JavaScript environment
uses: ./.github/actions/setup-javascript-environment
- name: Setup Ruby
uses: ./.github/actions/setup-ruby
- name: Download fonts from s3
run: ./scripts/setup/download-fonts
- name: Install bin modules
uses: ./.github/actions/setup-bin-modules
- name: Cache Metro bundler cache
uses: actions/cache@v4
with:
path: .cache/metro
key: metro-v1-${{ runner.os }}-${{ hashFiles('yarn.lock', 'babel.config.js', 'alias.js', 'metro.config.js') }}
- name: Deploy to Expo Updates
id: deploy
env:
EXPO_TOKEN: ${{ secrets.EXPO_UPDATES_TOKEN }}
DEPLOYMENT: ${{ inputs.deployment }}
PLATFORM: ${{ inputs.platform }}
DESCRIPTION: ${{ inputs.description }}
ROLLOUT_PERCENTAGE: ${{ inputs.rollout_percentage }}
CHECK_AGAINST_VERSION: ${{ inputs.check_against_version }}
run: |
args=("$DEPLOYMENT" "$DESCRIPTION" "$ROLLOUT_PERCENTAGE" --platform "$PLATFORM")
if [ "$CHECK_AGAINST_VERSION" = "true" ]; then
args+=(--check-against-version)
fi
./scripts/deploys/expo-updates/deploy-to-expo-updates "${args[@]}"
- name: Notify Slack of production publish
if: success() && inputs.deployment == 'production'
env:
DESCRIPTION: ${{ inputs.description }}
ROLLOUT_PERCENTAGE: ${{ inputs.rollout_percentage }}
run: bundle exec fastlane notify_expo_update_published description:"$DESCRIPTION" rollout_percentage:"$ROLLOUT_PERCENTAGE"
- name: Notify Slack of production publish failure
if: failure() && inputs.deployment == 'production'
run: bundle exec fastlane notify_expo_update_failed