diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9dad781..87cbdf5 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -8,65 +8,89 @@ jobs: build: runs-on: [self-hosted, macos, arm64, flutter] steps: + - name: Setup PATH + run: | + echo "/opt/homebrew/bin" >> $GITHUB_PATH + echo "/Users/freetlab/.pub-cache/bin" >> $GITHUB_PATH + export PATH="/opt/homebrew/bin:$PATH" + - name: Checkout - uses: actions/checkout@v4 + run: | + export PATH="/opt/homebrew/bin:$PATH" + if [ -d ".git" ]; then + git fetch origin main + git checkout main + git reset --hard origin/main + else + git clone http://192.168.0.33:3100/FreeTLab/farolero.git . + fi - name: Flutter version - run: flutter --version + run: | + export PATH="/opt/homebrew/bin:$PATH" + flutter --version - name: Get dependencies - run: flutter pub get - - - name: Analyze - run: flutter analyze + run: | + export PATH="/opt/homebrew/bin:$PATH" + flutter pub get - name: Generate l10n - run: flutter gen-l10n + run: | + export PATH="/opt/homebrew/bin:$PATH" + flutter gen-l10n + + - name: Analyze + run: | + export PATH="/opt/homebrew/bin:$PATH" + flutter analyze - name: Build APK Release - run: flutter build apk --release + run: | + export PATH="/opt/homebrew/bin:$PATH" + flutter build apk --release - name: Build AAB Release - run: flutter build appbundle --release + run: | + export PATH="/opt/homebrew/bin:$PATH" + flutter build appbundle --release - name: Extract version id: version run: | VERSION=$(grep 'version:' pubspec.yaml | head -1 | sed 's/version: //' | sed 's/+.*//') echo "version=v${VERSION}" >> $GITHUB_OUTPUT - echo "Version: v${VERSION}" - name: Deploy to ftl-builds - env: - SSH_KEY_PATH: /Users/freetlab/.openclaw/workspace/.secure/zimaboard_ed25519 - DEPLOY_HOST: 192.168.0.33 - DEPLOY_USER: ShanaiaBot run: | - VERSION=${{ steps.version.outputs.version }} + VERSION=$(grep 'version:' pubspec.yaml | head -1 | sed 's/version: //' | sed 's/+.*//') + VERSION="v${VERSION}" + SSH_KEY="/Users/freetlab/.openclaw/workspace/.secure/zimaboard_ed25519" + HOST="192.168.0.33" + USER="ShanaiaBot" BUILDS_DIR="/opt/ftl-builds/builds/farolero/${VERSION}" - - ssh -i "$SSH_KEY_PATH" -o StrictHostKeyChecking=no ${DEPLOY_USER}@${DEPLOY_HOST} "mkdir -p ${BUILDS_DIR}" - - scp -i "$SSH_KEY_PATH" \ + + ssh -i "$SSH_KEY" -o StrictHostKeyChecking=no ${USER}@${HOST} "mkdir -p ${BUILDS_DIR}" + + scp -i "$SSH_KEY" \ build/app/outputs/flutter-apk/app-release.apk \ - ${DEPLOY_USER}@${DEPLOY_HOST}:${BUILDS_DIR}/farolero-${VERSION}.apk - - scp -i "$SSH_KEY_PATH" \ + ${USER}@${HOST}:${BUILDS_DIR}/farolero-${VERSION}.apk + + scp -i "$SSH_KEY" \ build/app/outputs/bundle/release/app-release.aab \ - ${DEPLOY_USER}@${DEPLOY_HOST}:${BUILDS_DIR}/farolero-${VERSION}.aab + ${USER}@${HOST}:${BUILDS_DIR}/farolero-${VERSION}.aab - name: Notify Telegram if: always() - env: - BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} - CHAT_ID: 221721467 run: | - VERSION=${{ steps.version.outputs.version }} + export PATH="/opt/homebrew/bin:$PATH" + VERSION=$(grep 'version:' pubspec.yaml | head -1 | sed 's/version: //' | sed 's/+.*//') + VERSION="v${VERSION}" + BOT_TOKEN=$(grep -A1 "TELEGRAM_BOT_TOKEN" /Users/freetlab/Library/LaunchAgents/ai.openclaw.gateway.plist | grep string | sed 's/.*\(.*\)<\/string>/\1/' | tr -d '[:space:]') if [ "${{ job.status }}" = "success" ]; then MSG="✅ Farolero ${VERSION} — Build OK%0AAPK + AAB en builds.freetimelab.es" else MSG="❌ Farolero ${VERSION} — Build FAILED" fi curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \ - -d "chat_id=${CHAT_ID}&text=${MSG}&parse_mode=HTML" > /dev/null 2>&1 || true -# CI trigger Sat Apr 4 01:41:06 CEST 2026 + -d "chat_id=221721467&text=${MSG}" > /dev/null 2>&1 || true