Skip to content

Commit 36f02f1

Browse files
ci: Xcode release (#1449)
2 parents a8539b7 + aee2d66 commit 36f02f1

6 files changed

+79
-0
lines changed

.mise.toml

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ tuist = '4.41.0'
33
periphery = '2.21.1'
44
swiftformat = '0.54.5'
55
swiftlint = '0.57.0'
6+
sentry-cli = "latest"
67

TestFlight/WhatToTest.en-GB.txt

Whitespace-only changes.

TestFlight/WhatToTest.fr-FR.txt

Whitespace-only changes.

ci_scripts/check_preconditions.sh

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# CI_COMMIT - The Git commit hash that Xcode Cloud uses for the current build.
5+
# SENTRY_URL - The URL of our self hosted Sentry.
6+
# SENTRY_AUTH_TOKEN - The authentication token for Sentry.
7+
# SENTRY_PROJECT - The project id in our Sentry.
8+
9+
# Ensure we have a commit hash
10+
if [ -z "$CI_COMMIT" ]; then
11+
echo "Error: CI_COMMIT variable is not set."
12+
exit 1
13+
fi
14+
15+
# Ensure SENTRY_URL is set
16+
if [ -z "$SENTRY_URL" ]; then
17+
echo "Error: SENTRY_URL variable is not set."
18+
exit 1
19+
fi
20+
21+
# Ensure SENTRY_AUTH_TOKEN is set
22+
if [ -z "$SENTRY_AUTH_TOKEN" ]; then
23+
echo "Error: SENTRY_AUTH_TOKEN variable is not set."
24+
exit 1
25+
fi
26+
27+
# Ensure SENTRY_PROJECT is set
28+
if [ -z "$SENTRY_PROJECT" ]; then
29+
echo "Error: SENTRY_PROJECT variable is not set."
30+
exit 1
31+
fi
32+
33+
# Retrieve the commit title from the given commit hash
34+
commit_title="$(git log --format=%s -n 1 "$CI_COMMIT")"
35+
36+
# Check if the commit title begins with the expected string
37+
if [[ "$commit_title" == chore:\ Release\ build* ]]; then
38+
echo "Commit title is valid. Continuing..."
39+
else
40+
echo "Error: The commit title is not 'chore: Release build'."
41+
exit 1
42+
fi

ci_scripts/ci_post_clone.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
set -e
3+
4+
./check_preconditions.sh
5+
6+
cd ..
7+
8+
curl https://mise.run | sh
9+
export PATH="$HOME/.local/bin:$PATH"
10+
11+
mise install
12+
eval "$(mise activate bash --shims)"
13+
14+
tuist install
15+
tuist generate --no-open

ci_scripts/ci_post_xcodebuild.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
set -e
3+
4+
./check_preconditions.sh
5+
6+
cd ..
7+
8+
curl https://mise.run | sh
9+
export PATH="$HOME/.local/bin:$PATH"
10+
11+
mise install
12+
eval "$(mise activate bash --shims)"
13+
14+
15+
if [[ -n $CI_ARCHIVE_PATH ]];
16+
then
17+
# Upload dSYMs
18+
sentry-cli --url $SENTRY_URL --auth-token $SENTRY_AUTH_TOKEN upload-dif --org sentry --project $SENTRY_PROJECT $CI_ARCHIVE_PATH
19+
else
20+
echo "Archive path isn't available. Unable to run dSYMs uploading script."
21+
fi

0 commit comments

Comments
 (0)