Skip to content

Commit f67e294

Browse files
Fix uploading sources to Sentry
1 parent cdc8d2d commit f67e294

File tree

5 files changed

+51
-26
lines changed

5 files changed

+51
-26
lines changed

.github/workflows/publishing.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ jobs:
107107
run: make
108108

109109
- name: Trust SPM plugins
110-
run: bash .github/workflows/trust-spm-plugins.sh
111-
112-
- name: Set up Sentry
113-
if: ${{ matrix.distribution == 'app-store' }}
114-
run: curl -sL https://sentry.io/get-cli/ | sh
110+
run: bash Scripts/trust-spm-plugins.sh
115111

116112
- name: Install Protobuf
117113
run: brew install protobuf
118114

115+
- name: Install Sentry CLI
116+
if: ${{ matrix.distribution == 'app-store' }}
117+
run: brew install sentry-cli
118+
119119
- name: Build app
120120
run: |
121121
xcodebuild archive \
@@ -210,7 +210,7 @@ jobs:
210210
run: make
211211

212212
- name: Trust SPM plugins
213-
run: bash .github/workflows/trust-spm-plugins.sh
213+
run: bash Scripts/trust-spm-plugins.sh
214214

215215
- name: Run tests
216216
run: |

Fyreplace.xcodeproj/project.pbxproj

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@
118118
path = FyreplaceLegacy;
119119
sourceTree = "<group>";
120120
};
121+
4DF75C7B2E51F76400976B90 /* Scripts */ = {
122+
isa = PBXFileSystemSynchronizedRootGroup;
123+
path = Scripts;
124+
sourceTree = "<group>";
125+
};
121126
/* End PBXFileSystemSynchronizedRootGroup section */
122127

123128
/* Begin PBXFrameworksBuildPhase section */
@@ -159,6 +164,7 @@
159164
children = (
160165
4D0017DD2DF46E8E000A0C1B /* .github */,
161166
4D0017E22DF46E91000A0C1B /* Config */,
167+
4DF75C7B2E51F76400976B90 /* Scripts */,
162168
4D00182C2DF46E93000A0C1B /* Fyreplace */,
163169
4D926C0A2E363F2400A406D1 /* FyreplaceLegacy */,
164170
4D0018702DF46E95000A0C1B /* FyreplaceTests */,
@@ -267,6 +273,7 @@
267273
4D926C052E363F2400A406D1 /* Sources */,
268274
4D926C062E363F2400A406D1 /* Frameworks */,
269275
4D926C072E363F2400A406D1 /* Resources */,
276+
4DF75C812E51F7B400976B90 /* Upload Sources To Sentry */,
270277
);
271278
buildRules = (
272279
);
@@ -384,26 +391,20 @@
384391
name = "Upload Sources To Sentry";
385392
shellPath = /bin/sh;
386393
shellScript = (
387-
"if [ \"$CONFIGURATION\" = \"Debug\" ]",
388-
"then",
389-
" exit 0",
390-
"fi",
391-
"",
392-
"if which sentry-cli >/dev/null",
393-
"then",
394-
" ERROR=$(sentry-cli debug-files upload \\",
395-
" --org $SENTRY_ORG \\",
396-
" --project $SENTRY_PROJECT \\",
397-
" --auth-token $SENTRY_AUTH_TOKEN \\",
398-
" --include-sources \"$DWARF_DSYM_FOLDER_PATH\" \\",
399-
" --force-foreground 2>&1 >/dev/null)",
394+
"$(dirname $WORKSPACE_DIR)/Scripts/upload-sentry-sources.sh",
400395
"",
401-
" if [ ! $? -eq 0 ]",
402-
" then",
403-
" echo \"error: sentry-cli - $ERROR\"",
404-
" exit 1",
405-
" fi",
406-
"fi",
396+
);
397+
};
398+
4DF75C812E51F7B400976B90 /* Upload Sources To Sentry */ = {
399+
isa = PBXShellScriptBuildPhase;
400+
alwaysOutOfDate = 1;
401+
inputPaths = (
402+
"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}",
403+
);
404+
name = "Upload Sources To Sentry";
405+
shellPath = /bin/sh;
406+
shellScript = (
407+
"$(dirname $WORKSPACE_DIR)/Scripts/upload-sentry-sources.sh",
407408
"",
408409
);
409410
};
@@ -753,6 +754,7 @@
753754
CODE_SIGN_ENTITLEMENTS = Fyreplace/Config/Fyreplace.debug.entitlements;
754755
CODE_SIGN_IDENTITY = "Apple Development";
755756
CODE_SIGN_STYLE = Automatic;
757+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
756758
FYREPLACE_API_HOST_DEFAULT_KEY = FPApiHostLocal;
757759
FYREPLACE_API_HOST_DEV = dev.api.fyreplace.app;
758760
FYREPLACE_API_HOST_LOCAL = localhost;
@@ -793,6 +795,7 @@
793795
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
794796
CODE_SIGN_ENTITLEMENTS = Fyreplace/Config/Fyreplace.release.entitlements;
795797
CODE_SIGN_STYLE = Manual;
798+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
796799
FYREPLACE_API_HOST_DEFAULT_KEY = FPApiHostMain;
797800
FYREPLACE_API_HOST_DEV = dev.api.fyreplace.app;
798801
FYREPLACE_API_HOST_LOCAL = localhost;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
current_directory=$(dirname $0)
44
security_directory=~/Library/org.swift.swiftpm/security
55

6-
cp $current_directory/../../Fyreplace.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved /tmp/packages.json
6+
cp $current_directory/../Fyreplace.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved /tmp/packages.json
77
mkdir -p $security_directory
88

99
node $current_directory/get-fingerprint.js \

Scripts/upload-sentry-sources.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
export PATH="$PATH:/opt/homebrew/bin"
4+
5+
if [[ $CONFIGURATION -eq "Debug" ]]
6+
then
7+
echo "Skipping Sentry sources upload"
8+
elif [ -n $SENTRY_AUTH_TOKEN ]
9+
then
10+
ERROR=$(sentry-cli debug-files upload \
11+
--org $SENTRY_ORG \
12+
--project $SENTRY_PROJECT \
13+
--auth-token $SENTRY_AUTH_TOKEN \
14+
--include-sources "$DWARF_DSYM_FOLDER_PATH" \
15+
--force-foreground 2>&1 >/dev/null)
16+
17+
if [[ $? -ne 0 ]]
18+
then
19+
echo "error: sentry-cli - $ERROR"
20+
exit 1
21+
fi
22+
fi

0 commit comments

Comments
 (0)