Skip to content

feat: add xcode cloud ci guide #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions .github/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
"buildroot",
"canva",
"classpath",
"cocoapods",
"codemagic",
"codepush",
"codesign",
"elif",
"hunterws",
"libapp",
"libflutter",
"libupdater",
Expand Down
65 changes: 65 additions & 0 deletions src/content/docs/code-push/ci/xcode-cloud.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: Xcode Cloud Integration
description: Integrate Shorebird into Xcode Cloud
sidebar:
label: Xcode Cloud
order: 10
---

import Authentication from './_authentication.mdx';

If you are using [Xcode Cloud](https://developer.apple.com/xcode-cloud/) for
your iOS/Mac workflow you can use the script below to allow Xcode Cloud to send
releases to Shorebird.

```bash
#!/bin/sh

# Fail this script if any subcommand fails.
set -e

# The default execution directory of this script is the ci_scripts directory.
cd $CI_PRIMARY_REPOSITORY_PATH # change working directory to the root of your cloned repo.

# Install Flutter using git.
# git clone https://github.com/flutter/flutter.git --depth 1 -b stable $HOME/flutter

# Install Flutter using curl.
curl -sLO "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.29.3-stable.zip"
unzip -qq flutter_macos_3.29.3-stable.zip -d $HOME

export PATH="$PATH:$HOME/flutter/bin"

# Install Shorebird CLI.
curl --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/shorebirdtech/install/main/install.sh -sSf | bash
# Add Shorebird CLI to PATH.
export PATH="$PATH:$HOME/.shorebird/bin"

# Install Flutter artifacts for iOS (--ios), or macOS (--macos) platforms.
flutter precache --ios

# Install Flutter dependencies.
flutter pub get

# Install CocoaPods using Homebrew.
HOMEBREW_NO_AUTO_UPDATE=1 # disable homebrew's automatic updates.
brew install cocoapods

# Install CocoaPods dependencies.
# cd ios && pod install --repo-update # run `pod install` in the `ios` directory.

# Go back to the workspace root
# cd "$CI_PRIMARY_REPOSITORY_PATH"

echo "Shorebird Build running..."
shorebird release ios --flutter-version=3.29.3 --no-codesign

exit 0
```

Thanks to .hunterws on our Discord for taking the time to get this working and
then share with our community.

## Authentication

<Authentication />