#!/usr/bin/env bash set -euo pipefail REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$REPO_ROOT" PLATFORM="both" BUMP="patch" SKIP_BUMP=false UPLOAD=false ANDROID_TRACK="internal" usage() { cat <&2; usage; exit 1 ;; esac done if [ -f "$REPO_ROOT/.env.production" ]; then set -a # shellcheck disable=SC1091 source "$REPO_ROOT/.env.production" set +a fi if [ "$SKIP_BUMP" = false ]; then echo "→ Bumping version ($BUMP)" node bump-version.js "$BUMP" fi echo "→ Building web assets" npm run build echo "→ Syncing Capacitor" npx cap sync if [ -f Gemfile ] && command -v bundle >/dev/null 2>&1; then RUN="bundle exec fastlane" else RUN="fastlane" fi if [ "$PLATFORM" = "android" ] || [ "$PLATFORM" = "both" ]; then echo "→ Building signed Android release (.aab)" $RUN android release if [ "$UPLOAD" = true ]; then echo "→ Uploading Android release to Play Store ($ANDROID_TRACK track)" $RUN android upload track:"$ANDROID_TRACK" fi fi if [ "$PLATFORM" = "ios" ] || [ "$PLATFORM" = "both" ]; then echo "→ Building signed iOS release (.ipa)" $RUN ios release if [ "$UPLOAD" = true ]; then echo "→ Uploading iOS release to TestFlight" $RUN ios upload fi fi echo "✓ Release build complete" [ -f android/app/build/outputs/bundle/release/app-release.aab ] && echo " Android: android/app/build/outputs/bundle/release/app-release.aab" [ -f build/ios/Donetick.ipa ] && echo " iOS: build/ios/Donetick.ipa" echo "" echo "Next steps:" echo " git add . && git commit -m \"Release \$(node -p \"require('./package.json').version\")\"" echo " git tag v\$(node -p \"require('./package.json').version\") && git push origin develop --tags"