זרימות עבודה מעודכנות #1
This file contains 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 "שמור וזכור" APK | |
on: | |
push: | |
branches: | |
- flet-build | |
paths: | |
- '.github/workflows/build-apk2.yml' | |
jobs: | |
build-apk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install system dependencies (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential zlib1g-dev libncurses5-dev libffi-dev libssl-dev | |
- name: Set up Java (for Android) | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install Flutter SDK | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.24' | |
channel: 'stable' | |
- name: Set Android SDK environment variables | |
run: | | |
echo "ANDROID_SDK_ROOT=$HOME/Android/Sdk" >> $GITHUB_ENV | |
echo "NDK_VERSION=27.2.12479018" >> $GITHUB_ENV | |
echo "SDK_VERSION=android-35" >> $GITHUB_ENV | |
echo "PATH=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/platform-tools:$PATH" >> $GITHUB_ENV | |
- name: Install Android SDK cmdline-tools | |
run: | | |
mkdir -p "$ANDROID_SDK_ROOT/cmdline-tools" | |
sdkmanager --install "cmdline-tools;latest" --sdk_root="$ANDROID_SDK_ROOT" | |
mv "$ANDROID_SDK_ROOT/cmdline-tools/latest" "$ANDROID_SDK_ROOT/cmdline-tools/temp" | |
mv "$ANDROID_SDK_ROOT/cmdline-tools/temp" "$ANDROID_SDK_ROOT/cmdline-tools/latest" | |
- name: Check sdkmanager | |
run: | | |
ls -l $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/ | |
which sdkmanager | |
- name: Accept Android SDK licenses | |
run: yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses | |
- name: Install Android SDK components | |
run: | | |
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --list | grep ndk | |
yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "ndk;$NDK_VERSION" --channel=3 | |
yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "platforms;$SDK_VERSION" | |
- name: Create and activate virtual environment | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
- name: Install Flet, Cython and dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flet cython | |
pip install -r requirements.txt | |
pip install git+https://github.com/flet-dev/[email protected] | |
- name: Build APK for "שמור וזכור" | |
run: | | |
flet build apk | |
- name: Upload APK as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: שמור-וזכור-apk | |
path: build/apk/*.apk |