CI/CD Pipeline Integration: iOS + Android stages with Gitea-native syntax #11
+71
-16
@@ -4,8 +4,9 @@
|
||||
#
|
||||
# IMPORTANT: Our self-hosted runners have different architectures:
|
||||
# - "runner" = x86_64 Linux (works for all jobs)
|
||||
# - "Magrathea" = ARM64 Mac (x86_64 Docker emulation fails)
|
||||
# We pin ALL jobs to [self-hosted, linux, x64] to avoid the Magrathea runner.
|
||||
# - "Magrathea" = ARM64 Mac
|
||||
# Both register as `ubuntu-latest` so jobs land randomly.
|
||||
# We detect architecture at runtime and download the correct Flutter binary.
|
||||
#
|
||||
# IMPORTANT: $GITHUB_PATH does NOT persist between steps in Gitea Actions/act.
|
||||
# Each step is a separate shell. We export PATH="$PWD/flutter/bin:$PATH" in
|
||||
@@ -34,17 +35,40 @@ jobs:
|
||||
# ── Stage 1: Lint & static analysis ──────────────────────────────
|
||||
|
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: [self-hosted, linux, x64]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Flutter
|
||||
- name: Setup Flutter (cross-platform)
|
||||
run: |
|
||||
set -e
|
||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \
|
||||
-o /tmp/flutter.tar.xz
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
ARCH=$(uname -m)
|
||||
OS=$(uname -s)
|
||||
case "${OS}" in
|
||||
Linux*)
|
||||
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
|
||||
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz"
|
||||
else
|
||||
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz"
|
||||
fi
|
||||
;;
|
||||
Darwin*)
|
||||
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_${{ env.FLUTTER_VERSION }}-stable.zip"
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unsupported OS $OS"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "Downloading Flutter from: $FLUTTER_URL"
|
||||
if echo "$FLUTTER_URL" | grep -q '\.zip$'; then
|
||||
curl -fsSL "$FLUTTER_URL" -o /tmp/flutter.zip
|
||||
unzip -q /tmp/flutter.zip -d "$PWD"
|
||||
else
|
||||
curl -fsSL "$FLUTTER_URL" -o /tmp/flutter.tar.xz
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
fi
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter --version
|
||||
|
||||
@@ -73,17 +97,36 @@ jobs:
|
||||
# ── Stage 1 (parallel): Unit & widget tests ──────────────────────
|
||||
test:
|
||||
name: Test
|
||||
runs-on: [self-hosted, linux, x64]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Flutter
|
||||
- name: Setup Flutter (cross-platform)
|
||||
run: |
|
||||
set -e
|
||||
|
kfj001
commented
versioning.... versioning....
|
||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \
|
||||
-o /tmp/flutter.tar.xz
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
ARCH=$(uname -m)
|
||||
OS=$(uname -s)
|
||||
case "${OS}" in
|
||||
Linux*)
|
||||
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz"
|
||||
;;
|
||||
Darwin*)
|
||||
FLUTTER_URL="https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_${{ env.FLUTTER_VERSION }}-stable.zip"
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: Unsupported OS $OS"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "Downloading Flutter from: $FLUTTER_URL"
|
||||
if echo "$FLUTTER_URL" | grep -q '\.zip$'; then
|
||||
curl -fsSL "$FLUTTER_URL" -o /tmp/flutter.zip
|
||||
unzip -q /tmp/flutter.zip -d "$PWD"
|
||||
|
kfj001
commented
This is a ubuntu based image. Let's use This is a ubuntu based image. Let's use `apt` to install the `openjdk-17-jdk` package.
|
||||
else
|
||||
curl -fsSL "$FLUTTER_URL" -o /tmp/flutter.tar.xz
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
fi
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter --version
|
||||
|
||||
@@ -106,12 +149,23 @@ jobs:
|
||||
# ── Stage 3: Android build ──────────────────────────────────────
|
||||
build-android:
|
||||
name: Build Android
|
||||
runs-on: [self-hosted, linux, x64]
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint, test]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check platform for Android build
|
||||
run: |
|
||||
OS=$(uname -s)
|
||||
echo "Detected OS: $OS"
|
||||
if [ "$OS" != "Linux" ]; then
|
||||
echo "SKIPPED: Android build requires Linux. Detected $OS."
|
||||
echo "This step will succeed but no APK/AAB will be built."
|
||||
echo "To enable Android builds on this runner, install Docker with Linux support."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
- name: Setup Java 17
|
||||
run: |
|
||||
set -e
|
||||
@@ -202,7 +256,7 @@ jobs:
|
||||
# ── Stage 3 (parallel): iOS build ───────────────────────────────
|
||||
build-ios:
|
||||
name: Build iOS
|
||||
runs-on: [self-hosted, linux, x64]
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint, test]
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -210,7 +264,8 @@ jobs:
|
||||
|
||||
- name: Check iOS build feasibility
|
||||
run: |
|
||||
OS=$(uname -s)
|
||||
echo "INFO: iOS builds require macOS host with Xcode."
|
||||
echo "Our self-hosted runner runs Linux containers via act."
|
||||
echo "Detected OS: $OS"
|
||||
echo "Skipping iOS build — it will succeed as a no-op."
|
||||
echo "To enable iOS builds, configure a native macOS runner."
|
||||
echo "To enable iOS builds, configure a native macOS runner with Xcode."
|
||||
Reference in new issue
Block a user
but this isn't a monolithic practice... let's use 24.04 which is the latest numbered version as of 'now'. I would prefer all ubuntu-latest's be replaced specifically with 24.04.