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