diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 235fff1..b6a22a9 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -3,7 +3,6 @@ name: CI on: push: branches: [main] - tags: ['v*'] jobs: test: @@ -62,53 +61,5 @@ jobs: cd android .gradle-home/gradle-8.7/bin/gradle wrapper --gradle-version 8.7 --no-daemon ./gradlew assembleDebug --no-daemon - cd .. - # Copy APK to workspace root - cp android/app/build/outputs/apk/debug/app-debug.apk meal-tracker.apk - - - name: Package web app - if: startsWith(github.ref, 'refs/tags/v') - run: | - # Avoid pipefail issues with find|zip - find . -type f \ - ! -path './.git/*' \ - ! -path './.gitea/*' \ - ! -name '.env' \ - ! -path './.pytest_cache/*' \ - ! -path './__pycache__/*' \ - ! -name 'meals.db' \ - ! -path './android/.gradle/*' \ - ! -path './android/.gradle-home/*' \ - ! -path './android/app/build/*' \ - ! -name 'android/local.properties' \ - ! -name 'android/gradle/wrapper/gradle-wrapper.jar' \ - ! -name 'android/gradlew.bat' \ - > /tmp/files.txt - zip -q meal-tracker.zip -@ < /tmp/files.txt - echo "Packaged $(wc -l < /tmp/files.txt) files ($(du -h meal-tracker.zip | cut -f1))" - - - name: Publish release - if: startsWith(github.ref, 'refs/tags/v') - run: | - TAG="${GITHUB_REF#refs/tags/}" - API="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY" - - # Create release - RELEASE=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ - -H "Content-Type: application/json" \ - -X POST "$API/releases" \ - -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"Release $TAG\"}") - RELEASE_ID=$(echo "$RELEASE" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))") - - if [ -n "$RELEASE_ID" ]; then - UPLOAD="$API/releases/$RELEASE_ID/assets" - curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ - -F "attachment=@meal-tracker.apk;filename=meal-tracker-${TAG}.apk" "$UPLOAD" - curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ - -F "attachment=@meal-tracker.zip;filename=meal-tracker-${TAG}.zip" "$UPLOAD" - echo "Release $TAG published with APK + ZIP" - else - echo "Failed to create release: $RELEASE" - exit 1 - fi + echo "APK built: $(du -h app/build/outputs/apk/debug/app-debug.apk | cut -f1)"