Warn on low iOS alarm volume #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build iOS IPA + Android APK | |
| on: | |
| push: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: macos-15 | |
| defaults: | |
| run: | |
| working-directory: work_timer | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| - name: Get version from pubspec | |
| id: version | |
| run: | | |
| echo "name=$(grep '^version:' pubspec.yaml | awk '{print $2}' | cut -d'+' -f1)" >> $GITHUB_OUTPUT | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build iOS (no codesign) | |
| run: flutter build ios --release --no-codesign | |
| - name: Package IPA | |
| run: | | |
| cd build/ios/iphoneos | |
| mkdir Payload | |
| cp -r Runner.app Payload/ | |
| zip -r Sift.ipa Payload/ | |
| mv Sift.ipa $GITHUB_WORKSPACE/Sift.ipa | |
| - name: Configure Android signing | |
| run: | | |
| echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" > /tmp/ks.b64 | |
| openssl base64 -d -A -in /tmp/ks.b64 -out android/upload-keystore.jks | |
| cat > android/key.properties <<PROP | |
| storePassword=${{ secrets.ANDROID_STORE_PASSWORD }} | |
| keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }} | |
| keyAlias=${{ secrets.ANDROID_KEY_ALIAS }} | |
| storeFile=../upload-keystore.jks | |
| PROP | |
| - name: Build Android APK (release, signed) | |
| run: | | |
| yes | flutter doctor --android-licenses > /dev/null 2>&1 || true | |
| for attempt in 1 2 3; do | |
| if flutter build apk --release; then | |
| break | |
| fi | |
| if [ "$attempt" = "3" ]; then | |
| exit 1 | |
| fi | |
| echo "Android build failed; cleaning CMake cache and retrying ($attempt/3)..." | |
| rm -rf "$ANDROID_HOME/cmake/3.22.1" "$ANDROID_HOME/.temp" "$ANDROID_SDK_ROOT/cmake/3.22.1" "$ANDROID_SDK_ROOT/.temp" || true | |
| sleep 15 | |
| done | |
| cp build/app/outputs/flutter-apk/app-release.apk $GITHUB_WORKSPACE/Sift.apk | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.version.outputs.name }} | |
| name: Sift v${{ steps.version.outputs.name }} | |
| files: | | |
| ${{ github.workspace }}/Sift.ipa | |
| ${{ github.workspace }}/Sift.apk | |
| overwrite_files: true | |
| make_latest: true | |
| - name: Update AltStore source | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| SIZE=$(stat -f%z Sift.ipa) | |
| VERSION="${{ steps.version.outputs.name }}" | |
| DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
| python3 - <<EOF | |
| import json | |
| with open("altstore-source.json") as f: | |
| source = json.load(f) | |
| app = source["apps"][0] | |
| app["bundleIdentifier"] = "com.utsapoddar.sift" | |
| app["version"] = "$VERSION" | |
| app["versionDate"] = "$DATE" | |
| app["downloadURL"] = f"https://github.com/utsapoddar/sift-work-timer/releases/download/v$VERSION/Sift.ipa" | |
| app["size"] = $SIZE | |
| with open("altstore-source.json", "w") as f: | |
| json.dump(source, f, indent=2) | |
| f.write("\n") | |
| EOF | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| git add altstore-source.json | |
| git diff --staged --quiet || git commit -m "chore: update AltStore source to v$VERSION [skip ci]" | |
| git pull --rebase --autostash && git push |