-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
83 lines (76 loc) · 2.79 KB
/
action.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
name: "Upload Symbols to Embrace"
description: "Upload symbols for your application to Embrace."
branding:
icon: "upload-cloud"
color: "yellow"
inputs:
app_id:
description: "Embrace app identifier (5 characters)"
required: true
api_token:
description: "Embrace symbol upload API token (32 hex characters), see https://dash.embrace.io/settings/organization/api"
required: true
tool_version:
description: "Version for embrace_support.zip tool"
required: false
default: "latest"
runs:
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
using: "composite"
steps:
- name: Determine embrace_support version
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ '${{ inputs.tool_version }}' == 'latest' ]; then
version=$(gh release list --repo embrace-io/action-symbol-upload --json tagName --jq '.[] | select(.tagName | startswith("embrace_support-")) | .tagName' --order desc | head -1)
else
version='${{ inputs.tool_version }}'
fi
echo "Using tool version ${version}"
echo "SUPPORT_TOOL=${version}" >> $GITHUB_ENV
shell: bash
- name: Download embrace_support.zip
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release --repo embrace-io/action-symbol-upload download ${{ env.SUPPORT_TOOL }} --pattern 'embrace_support-*' --clobber
shell: bash
- name: Verify and extract embrace_support.zip
run: |
if /usr/bin/shasum -a 256 -c ${{ env.SUPPORT_TOOL }}.zip.sha256; then
unzip -o ${{ env.SUPPORT_TOOL }}.zip
else
echo "Checksum verification failed, aborting."
exit 1
fi
shell: bash
- name: Determine platform and architecture
run: |
upload_binary=embrace_symbol_upload.$(uname | tr A-Z a-z)
if [ $(uname) == "Linux" ]; then
if [ $(uname -m) == "aarch64" ]; then
upload_binary=${upload_binary}-arm64
else
upload_binary=${upload_binary}-amd64
fi
fi
echo "Will use ${upload_binary}"
echo "SYMBOL_UPLOAD_BINARY=${upload_binary}" >> $GITHUB_ENV
shell: bash
# https://embrace.io/docs/ios/open-source/symbolicating-crash-reports/
- name: Upload dSYM symbols
env:
EMBRACE_APP: "${{ inputs.app_id }}"
EMBRACE_API_TOKEN: "${{ inputs.api_token }}"
EMBRACE_DEBUG_DSYM: "1"
EMBRACE_LOG_LEVEL: "info"
BUILD_ROOT: "${{ github.workspace }}"
run: |
for dir in $(find . -type d -name \*.dSYM); do
for dsym_file in "$dir"/Contents/Resources/DWARF/*; do
echo Running ./${SYMBOL_UPLOAD_BINARY} --dsym "$dsym_file"
./${SYMBOL_UPLOAD_BINARY} --dsym "$dsym_file"
done
done
shell: bash