Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .buildkite/commands/build-tvos-app-store.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :hammer_and_wrench: Building"
# The `0.` prefix keeps CI-driven builds lexicographically below any real release build code.
# CI-driven tvOS uploads use a low 0.x build number. App Store Connect may
# reject these after a release build already exists for the same version.
bundle exec fastlane build_app_store_connect_tvos "build_number:0.$BUILDKITE_BUILD_NUMBER"
23 changes: 21 additions & 2 deletions .buildkite/commands/release-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,31 @@

# Ensure we get the latest commit of the `release/*` branch, especially to get last version bump commit before building the release
RELEASE_VERSION="${1:?RELEASE_VERSION parameter missing}"
RELEASE_PLATFORM="${2:-${RELEASE_PLATFORM:-}}"

if [[ -z "$RELEASE_PLATFORM" ]]; then
echo "RELEASE_PLATFORM parameter missing. Expected 'ios' or 'tvos'." >&2
exit 1
fi

"$(dirname "${BASH_SOURCE[0]}")/checkout-release-branch.sh" "$RELEASE_VERSION"

"$(dirname "${BASH_SOURCE[0]}")/shared_setup.sh"

echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :hammer_and_wrench: Building"
bundle exec fastlane build_app_store_connect
case "$RELEASE_PLATFORM" in
ios)
echo "--- :hammer_and_wrench: Building iOS"
bundle exec fastlane build_app_store_connect
;;
tvos)
echo "--- :hammer_and_wrench: Building tvOS"
bundle exec fastlane build_app_store_connect_tvos
;;
*)
echo "Unsupported RELEASE_PLATFORM: $RELEASE_PLATFORM. Expected 'ios' or 'tvos'." >&2
exit 1
;;
esac
101 changes: 82 additions & 19 deletions .buildkite/commands/release-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,100 @@

# Ensure we get the latest commit of the `release/*` branch, especially to get last version bump commit before publishing the GitHub Release and creating the git tag
RELEASE_VERSION="${1:?RELEASE_VERSION parameter missing}"
"$(dirname "${BASH_SOURCE[0]}")/checkout-release-branch.sh" "$RELEASE_VERSION"

BETA_RELEASE=${2:-true} # use second call param, default to true for safety
RELEASE_PLATFORM="${3:-${RELEASE_PLATFORM:-}}"
NOTIFY_SLACK="${4:-${NOTIFY_SLACK:-}}"
CREATE_GITHUB_RELEASE="${5:-${CREATE_GITHUB_RELEASE:-}}"

if [[ -z "$RELEASE_PLATFORM" ]]; then
echo "RELEASE_PLATFORM parameter missing. Expected 'ios' or 'tvos'." >&2
exit 1
fi

case "$RELEASE_PLATFORM" in
ios)
PLATFORM_NAME="iOS"
IPA_PATH="artifacts/pocket-casts.ipa"
DSYM_PATH="artifacts/pocket-casts.app.dSYM.zip"
ARCHIVE_ZIP_PATH="artifacts/pocket-casts.xcarchive.zip"
SENTRY_ANNOTATION_CONTEXT="sentry-failure-ios"
TESTFLIGHT_LANE="upload_app_store_connect_build_to_testflight"
;;
tvos)
PLATFORM_NAME="tvOS"
IPA_PATH="artifacts/pocket-casts-tvos.ipa"
DSYM_PATH="artifacts/pocket-casts-tvos.app.dSYM.zip"
ARCHIVE_ZIP_PATH="artifacts/pocket-casts-tvos.xcarchive.zip"
SENTRY_ANNOTATION_CONTEXT="sentry-failure-tvos"
TESTFLIGHT_LANE="upload_app_store_connect_build_to_testflight_tvos"
;;
*)
echo "Unsupported RELEASE_PLATFORM: $RELEASE_PLATFORM. Expected 'ios' or 'tvos'." >&2
exit 1
;;
esac

if [[ -z "$NOTIFY_SLACK" ]]; then
if [[ "$RELEASE_PLATFORM" == "ios" ]]; then
NOTIFY_SLACK="true"
else
NOTIFY_SLACK="false"
fi
fi

if [[ -z "$CREATE_GITHUB_RELEASE" ]]; then
if [[ "$RELEASE_PLATFORM" == "ios" ]]; then
CREATE_GITHUB_RELEASE="true"
else
CREATE_GITHUB_RELEASE="false"
fi
fi

echo "Running $0 with BETA_RELEASE = $BETA_RELEASE..."
echo "Running $0 with BETA_RELEASE = $BETA_RELEASE, RELEASE_PLATFORM = $RELEASE_PLATFORM, NOTIFY_SLACK = $NOTIFY_SLACK, CREATE_GITHUB_RELEASE = $CREATE_GITHUB_RELEASE..."

"$(dirname "${BASH_SOURCE[0]}")/checkout-release-branch.sh" "$RELEASE_VERSION"

echo "--- :arrow_down: Downloading Artifacts"
ARTIFACTS_DIR='artifacts' # Defined in Fastlane, see ARTIFACTS_FOLDER
STEP=testflight_build
buildkite-agent artifact download "$ARTIFACTS_DIR/*.ipa" . --step $STEP
buildkite-agent artifact download "$ARTIFACTS_DIR/*.zip" . --step $STEP
STEP=release_build
buildkite-agent artifact download "$IPA_PATH" . --step "$STEP"
buildkite-agent artifact download "$DSYM_PATH" . --step "$STEP"
buildkite-agent artifact download "$ARCHIVE_ZIP_PATH" . --step "$STEP"

echo "--- :rubygems: Setting up Gems"
install_gems

echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :testflight: Uploading to TestFlight"
bundle exec fastlane upload_app_store_connect_build_to_testflight
echo "--- :github: Updating GitHub Release"
bundle exec fastlane create_release_on_github beta_release:"$BETA_RELEASE" archive_zip_path:"$ARCHIVE_ZIP_PATH" notify_slack:false create_release:"$CREATE_GITHUB_RELEASE"

echo "--- :arrow_up: Uploading dSYM to Sentry"
set +e
bundle exec fastlane symbols_upload
SENTRY_UPLOAD_STATUS=$?
set -e
upload_symbols() {
local platform="$1"
local dsym_path="$2"
local annotation_context="$3"

if [[ $SENTRY_UPLOAD_STATUS -ne 0 ]]; then
echo "^^^ +++ Failed to upload dSYM to Sentry! Make sure to download dSYM from the build step artifacts and upload manually."
buildkite-agent annotate --style error --context sentry-failure 'Failed to upload dSYM to Sentry! Make sure to download dSYM from the build step artifacts and upload manually.'
fi
echo "--- :arrow_up: Uploading $platform dSYM to Sentry"
set +e
bundle exec fastlane symbols_upload "dsym_path:$dsym_path"
local sentry_upload_status=$?
set -e

if [[ $sentry_upload_status -ne 0 ]]; then
echo "^^^ +++ Failed to upload $platform dSYM to Sentry! Make sure to download dSYM from the build step artifacts and upload manually."
buildkite-agent annotate --style error --context "$annotation_context" "Failed to upload $platform dSYM to Sentry! Make sure to download dSYM from the build step artifacts and upload manually."
fi
}

echo "--- :github: Creating GitHub Release"
bundle exec fastlane create_release_on_github beta_release:"$BETA_RELEASE"
upload_symbols "$PLATFORM_NAME" "$DSYM_PATH" "$SENTRY_ANNOTATION_CONTEXT"

echo "--- :testflight: Uploading $PLATFORM_NAME to TestFlight"
bundle exec fastlane "$TESTFLIGHT_LANE" ipa_path:"$IPA_PATH"

if [[ "$NOTIFY_SLACK" == "true" ]]; then
echo "--- :slack: Notifying Slack"
bundle exec fastlane notify_release_on_slack beta_release:"$BETA_RELEASE"
else
echo "--- :slack: Skipping Slack notification"
fi
12 changes: 6 additions & 6 deletions .buildkite/release-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ env:

steps:

- label: "🛠 Release Build (App Store Connect)"
key: testflight_build
command: .buildkite/commands/release-build.sh "${RELEASE_VERSION}"
- label: "🛠 Release Build (${RELEASE_PLATFORM})"
key: release_build
command: .buildkite/commands/release-build.sh "${RELEASE_VERSION}" "${RELEASE_PLATFORM}"
priority: 1
plugins: [$CI_TOOLKIT]
artifact_paths:
Expand All @@ -23,9 +23,9 @@ steps:
notify:
- slack: "#build-and-ship"

- label: ":testflight: Release Upload (TestFlight, Sentry, GitHub)"
depends_on: testflight_build
command: .buildkite/commands/release-upload.sh "${RELEASE_VERSION}" "${BETA_RELEASE}"
- label: ":testflight: Release Upload (${RELEASE_PLATFORM})"
depends_on: release_build
command: .buildkite/commands/release-upload.sh "${RELEASE_VERSION}" "${BETA_RELEASE}" "${RELEASE_PLATFORM}" "${NOTIFY_SLACK}" "${CREATE_GITHUB_RELEASE}"
priority: 1
plugins: [$CI_TOOLKIT]
notify:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem 'danger-dangermattic', '~> 1.3'
gem 'fastlane', '~> 2.236'
gem 'fastlane-plugin-firebase_app_distribution', '~> 1.0'
gem 'fastlane-plugin-sentry', '~> 2.5'
gem 'fastlane-plugin-wpmreleasetoolkit', '~> 14.7'
gem 'fastlane-plugin-wpmreleasetoolkit', '~> 14.9.0'
# To avoid errors like:
#
# SSL_connect returned=1 errno=0 peeraddr=3.5.132.155:443 state=error: certificate verify failed (unable to get certificate CRL)
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ GEM
google-apis-firebaseappdistribution_v1alpha (>= 0.12.0)
fastlane-plugin-sentry (2.5.8)
os (~> 1.1, >= 1.1.4)
fastlane-plugin-wpmreleasetoolkit (14.7.0)
fastlane-plugin-wpmreleasetoolkit (14.9.0)
buildkit (~> 1.5)
chroma (= 0.2.0)
diffy (~> 3.3)
Expand Down Expand Up @@ -380,7 +380,7 @@ DEPENDENCIES
fastlane (~> 2.236)
fastlane-plugin-firebase_app_distribution (~> 1.0)
fastlane-plugin-sentry (~> 2.5)
fastlane-plugin-wpmreleasetoolkit (~> 14.7)
fastlane-plugin-wpmreleasetoolkit (~> 14.9.0)
openssl (~> 4.0)
rake (>= 12.0, < 14.0)
rubocop (~> 1.88)
Expand Down
3 changes: 0 additions & 3 deletions Pocket Casts TV App/Config/PocketCastsTV.base.xcconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#include "../../config/PocketCasts.base.xcconfig"

// tvOS tracks its own marketing version — still early-days, so we don't piggyback on the iOS `VERSION_SHORT` release automation.
MARKETING_VERSION = 0.1

SDKROOT = appletvos
TVOS_DEPLOYMENT_TARGET = 26.0
TARGETED_DEVICE_FAMILY = 3
Expand Down
Loading