From 22cde6d2d7f94bc8e81fbe762229f9c1034067f3 Mon Sep 17 00:00:00 2001 From: Krishna Kumar Date: Thu, 21 May 2026 12:05:55 -0500 Subject: [PATCH] Add Gitea CI workflow with IPA distribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On every push to swift/master: compile-checks against the simulator (no signing required) then builds a development IPA and deploys it to the shared OTA server at krishnas-mac-studio.tail37d544.ts.net:8443. Modelled on 1ai's ci.yaml — runs on the local macos act runner so the keychain is live and automatic signing works without any cert setup. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yaml | 50 ++++++++++++++++++++++++++ scripts/ipa-server/build-and-deploy.sh | 8 +++-- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..94a144d --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: + - master + - swift + - 'feat/**' + - 'feature/**' + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: macos + env: + DEVELOPER_DIR: /Applications/Xcode-26.3.app/Contents/Developer + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Generate Xcode project + run: xcodegen generate + + - name: Build (simulator, compile check) + run: | + SIM_ID=$(xcrun simctl list devices available -j | python3 -c " + import json,sys + for rt,devs in json.load(sys.stdin)['devices'].items(): + if 'iOS' in rt: + for d in devs: + if 'iPhone' in d['name'] and d['isAvailable']: + print(d['udid']); sys.exit() + " 2>/dev/null) + echo "Using simulator: $SIM_ID" + xcodebuild build \ + -project Marks.xcodeproj \ + -scheme Marks \ + -destination "platform=iOS Simulator,id=$SIM_ID" \ + -configuration Debug \ + CODE_SIGNING_ALLOWED=NO \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO \ + DEVELOPMENT_TEAM="" + + - name: Build IPA and deploy to OTA server + run: ./scripts/ipa-server/build-and-deploy.sh + continue-on-error: true diff --git a/scripts/ipa-server/build-and-deploy.sh b/scripts/ipa-server/build-and-deploy.sh index 2fbfbf7..2d9f248 100755 --- a/scripts/ipa-server/build-and-deploy.sh +++ b/scripts/ipa-server/build-and-deploy.sh @@ -34,9 +34,13 @@ elif [ -n "$1" ] && [ "$1" != "$CURRENT_BRANCH" ]; then COMMIT=$(git rev-parse --short HEAD) echo "📌 Building commit: $COMMIT on $1" else - echo "⬇️ Pulling latest $CURRENT_BRANCH..." - git pull origin "$CURRENT_BRANCH" COMMIT=$(git rev-parse --short HEAD) + if git ls-remote --exit-code origin "$CURRENT_BRANCH" &>/dev/null; then + echo "⬇️ Pulling latest $CURRENT_BRANCH..." + git pull origin "$CURRENT_BRANCH" + else + echo "⚠️ No remote for $CURRENT_BRANCH — building local HEAD" + fi echo "📌 Building commit: $COMMIT on $CURRENT_BRANCH" fi