Skip to content

Commit

Permalink
ci: Xcode release (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann authored Feb 25, 2025
2 parents a8539b7 + aee2d66 commit 36f02f1
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ tuist = '4.41.0'
periphery = '2.21.1'
swiftformat = '0.54.5'
swiftlint = '0.57.0'
sentry-cli = "latest"

Empty file added TestFlight/WhatToTest.en-GB.txt
Empty file.
Empty file added TestFlight/WhatToTest.fr-FR.txt
Empty file.
42 changes: 42 additions & 0 deletions ci_scripts/check_preconditions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh
set -e

# CI_COMMIT - The Git commit hash that Xcode Cloud uses for the current build.
# SENTRY_URL - The URL of our self hosted Sentry.
# SENTRY_AUTH_TOKEN - The authentication token for Sentry.
# SENTRY_PROJECT - The project id in our Sentry.

# Ensure we have a commit hash
if [ -z "$CI_COMMIT" ]; then
echo "Error: CI_COMMIT variable is not set."
exit 1
fi

# Ensure SENTRY_URL is set
if [ -z "$SENTRY_URL" ]; then
echo "Error: SENTRY_URL variable is not set."
exit 1
fi

# Ensure SENTRY_AUTH_TOKEN is set
if [ -z "$SENTRY_AUTH_TOKEN" ]; then
echo "Error: SENTRY_AUTH_TOKEN variable is not set."
exit 1
fi

# Ensure SENTRY_PROJECT is set
if [ -z "$SENTRY_PROJECT" ]; then
echo "Error: SENTRY_PROJECT variable is not set."
exit 1
fi

# Retrieve the commit title from the given commit hash
commit_title="$(git log --format=%s -n 1 "$CI_COMMIT")"

# Check if the commit title begins with the expected string
if [[ "$commit_title" == chore:\ Release\ build* ]]; then
echo "Commit title is valid. Continuing..."
else
echo "Error: The commit title is not 'chore: Release build'."
exit 1
fi
15 changes: 15 additions & 0 deletions ci_scripts/ci_post_clone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -e

./check_preconditions.sh

cd ..

curl https://mise.run | sh
export PATH="$HOME/.local/bin:$PATH"

mise install
eval "$(mise activate bash --shims)"

tuist install
tuist generate --no-open
21 changes: 21 additions & 0 deletions ci_scripts/ci_post_xcodebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
set -e

./check_preconditions.sh

cd ..

curl https://mise.run | sh
export PATH="$HOME/.local/bin:$PATH"

mise install
eval "$(mise activate bash --shims)"


if [[ -n $CI_ARCHIVE_PATH ]];
then
# Upload dSYMs
sentry-cli --url $SENTRY_URL --auth-token $SENTRY_AUTH_TOKEN upload-dif --org sentry --project $SENTRY_PROJECT $CI_ARCHIVE_PATH
else
echo "Archive path isn't available. Unable to run dSYMs uploading script."
fi

0 comments on commit 36f02f1

Please sign in to comment.