- This requires Expo
SDK 47
, with[email protected]
or above and[email protected]
or above. - You should also install
@babel/cli
and@sentry/cli
- See Expo docs
- Configure the
sentry-expo/upload-sourcemaps
postPublish
hook inapp.json
orapp.config.ts
. Expo docs. The script will retrieve your Sentry auth config through theses props.
{
"hooks": {
"postPublish": [
{
"file": "sentry-expo/upload-sourcemaps",
"config": {
"organization": "my-sentry-org",
"project": "my-project-name",
"authToken": "<snip>"
}
}
]
}
}
2. Copy `upload_sourcemaps_to_sentry_es6.js` to `.github/workflows`
- When you run
eas update
, pipe the output tooutput.txt
eas update --non-interactive --branch production --message "Some message" | tee output.txt
deploy_ota:
steps:
- name: Check for EXPO_TOKEN
run: |
if [ -z "${{ secrets.EXPO_TOKEN }}" ]; then
echo "You must provide an EXPO_TOKEN secret linked to this project's Expo account in this repo's secrets. Learn more: https://docs.expo.dev/eas-update/github-actions"
exit 1
fi
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: yarn
- name: Setup Expo
uses: expo/expo-github-action@v7
with:
expo-version: 6.2.1
eas-version: 3.5.2
token: ${{ secrets.EXPO_TOKEN }}
- name: Find yarn cache
id: yarn-cache-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Restore cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install app dependencies
run: yarn install --immutable
- name: Publish OTA update
run: |
eas update --non-interactive --branch production --message "New production update" | tee output.txt
- name: Transpile upload_sourcemaps_to_sentry
shell: bash
run: yarn babel .github/workflows/upload_sourcemaps_to_sentry_es6.js --out-file .github/workflows/upload_sourcemaps_to_sentry.js
- name: Upload sourcemaps to Sentry
shell: bash
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: node .github/workflows/upload_sourcemaps_to_sentry.js
This is adapated from @ajacquierbret
's comment in this Expo issue.