fix(ci): use ubuntu-latest runner label and Flutter 3.35.3 (correct version)
- Runner label: self-hosted -> ubuntu-latest (act registers as ubuntu-latest, not self-hosted) - Flutter SDK: 3.44.8 (nonexistent) -> 3.35.3 (latest stable) - SDK platform: macOS -> Linux (act runs Linux containers) - JDK: macOS ARM64 -> Linux x86_64 - Android cmdline tools: macOS -> Linux - iOS build: skip gracefully (requires macOS host with Xcode)
This commit is contained in:
+29
-35
@@ -2,10 +2,9 @@
|
|||||||
# Triggers on push and pull_request
|
# Triggers on push and pull_request
|
||||||
# Stages: lint -> test -> build (Android + iOS) -> artifacts
|
# Stages: lint -> test -> build (Android + iOS) -> artifacts
|
||||||
#
|
#
|
||||||
# CRITICAL: Gitea's `act` runner on Magrathea (macOS ARM64) runs `ubuntu-latest`
|
# NOTE: Gitea's `act` runner registers as `ubuntu-latest`. Jobs MUST use
|
||||||
# jobs inside x86_64 Docker containers where neither Linux x86_64 nor macOS SDKs
|
# `runs-on: ubuntu-latest` to be picked up. The runner executes jobs inside
|
||||||
# can execute. ALL jobs MUST use [self-hosted, macos] to run natively on the
|
# x86_64 Linux Docker containers, so we use Linux SDK binaries.
|
||||||
# Mac host with macOS ARM64 binaries.
|
|
||||||
|
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
@@ -24,17 +23,17 @@ jobs:
|
|||||||
# ── Stage 1: Lint & static analysis ──────────────────────────────
|
# ── Stage 1: Lint & static analysis ──────────────────────────────
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
run: |
|
run: |
|
||||||
# Direct Flutter SDK download — macOS ARM64 (native self-hosted runner)
|
# Direct Flutter SDK download — Linux x86_64 (act container)
|
||||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.44.8-stable.zip" \
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.35.3-stable.tar.xz" \
|
||||||
-o flutter.zip
|
-o flutter.tar.xz
|
||||||
unzip -q flutter.zip
|
tar -xf flutter.tar.xz
|
||||||
export PATH="$PWD/flutter/bin:$PATH"
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
flutter --version
|
flutter --version
|
||||||
echo "$PWD/flutter/bin" >> "$GITHUB_PATH" || echo "$PWD/flutter/bin" >> "$HOME/.env_path"
|
echo "$PWD/flutter/bin" >> "$GITHUB_PATH" || echo "$PWD/flutter/bin" >> "$HOME/.env_path"
|
||||||
@@ -56,7 +55,7 @@ jobs:
|
|||||||
# ── Stage 2: Unit & widget tests ─────────────────────────────────
|
# ── Stage 2: Unit & widget tests ─────────────────────────────────
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
needs: [lint]
|
needs: [lint]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -64,9 +63,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.44.8-stable.zip" \
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.35.3-stable.tar.xz" \
|
||||||
-o flutter.zip
|
-o flutter.tar.xz
|
||||||
unzip -q flutter.zip
|
tar -xf flutter.tar.xz
|
||||||
export PATH="$PWD/flutter/bin:$PATH"
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
flutter --version
|
flutter --version
|
||||||
echo "$PWD/flutter/bin" >> "$GITHUB_PATH" || echo "$PWD/flutter/bin" >> "$HOME/.env_path"
|
echo "$PWD/flutter/bin" >> "$GITHUB_PATH" || echo "$PWD/flutter/bin" >> "$HOME/.env_path"
|
||||||
@@ -84,7 +83,7 @@ jobs:
|
|||||||
# ── Stage 3: Android build ──────────────────────────────────────
|
# ── Stage 3: Android build ──────────────────────────────────────
|
||||||
build-android:
|
build-android:
|
||||||
name: Build Android
|
name: Build Android
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
needs: [test]
|
needs: [test]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -92,8 +91,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Java 17
|
- name: Setup Java 17
|
||||||
run: |
|
run: |
|
||||||
# Direct Temurin JDK download — macOS ARM64
|
# Direct Temurin JDK download — Linux x86_64
|
||||||
curl -fsSL "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.12_7.tar.gz" \
|
curl -fsSL "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_linux_hotspot_17.0.12_7.tar.gz" \
|
||||||
-o jdk.tar.gz
|
-o jdk.tar.gz
|
||||||
mkdir -p "$HOME/jdk"
|
mkdir -p "$HOME/jdk"
|
||||||
tar -xzf jdk.tar.gz -C "$HOME/jdk" --strip-components=1
|
tar -xzf jdk.tar.gz -C "$HOME/jdk" --strip-components=1
|
||||||
@@ -105,9 +104,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.44.8-stable.zip" \
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.35.3-stable.tar.xz" \
|
||||||
-o flutter.zip
|
-o flutter.tar.xz
|
||||||
unzip -q flutter.zip
|
tar -xf flutter.tar.xz
|
||||||
export PATH="$PWD/flutter/bin:$PATH"
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
flutter --version
|
flutter --version
|
||||||
echo "$PWD/flutter/bin" >> "$GITHUB_PATH" || echo "$PWD/flutter/bin" >> "$HOME/.env_path"
|
echo "$PWD/flutter/bin" >> "$GITHUB_PATH" || echo "$PWD/flutter/bin" >> "$HOME/.env_path"
|
||||||
@@ -116,7 +115,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export ANDROID_HOME="${HOME}/android-sdk"
|
export ANDROID_HOME="${HOME}/android-sdk"
|
||||||
mkdir -p "${ANDROID_HOME}/cmdline-tools"
|
mkdir -p "${ANDROID_HOME}/cmdline-tools"
|
||||||
curl -fsSL "https://dl.google.com/android/repository/commandlinetools-mac-11076708_latest.zip" -o cmdline-tools.zip
|
curl -fsSL "https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" -o cmdline-tools.zip
|
||||||
unzip -q cmdline-tools.zip -d "${ANDROID_HOME}/cmdline-tools"
|
unzip -q cmdline-tools.zip -d "${ANDROID_HOME}/cmdline-tools"
|
||||||
mv "${ANDROID_HOME}/cmdline-tools/cmdline-tools" "${ANDROID_HOME}/cmdline-tools/latest"
|
mv "${ANDROID_HOME}/cmdline-tools/cmdline-tools" "${ANDROID_HOME}/cmdline-tools/latest"
|
||||||
export PATH="${ANDROID_HOME}/cmdline-tools/latest/bin:${PATH}"
|
export PATH="${ANDROID_HOME}/cmdline-tools/latest/bin:${PATH}"
|
||||||
@@ -176,7 +175,7 @@ jobs:
|
|||||||
# ── Stage 3 (parallel): iOS build ───────────────────────────────
|
# ── Stage 3 (parallel): iOS build ───────────────────────────────
|
||||||
build-ios:
|
build-ios:
|
||||||
name: Build iOS
|
name: Build iOS
|
||||||
runs-on: self-hosted
|
runs-on: ubuntu-latest
|
||||||
needs: [test]
|
needs: [test]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -184,9 +183,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.44.8-stable.zip" \
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.35.3-stable.tar.xz" \
|
||||||
-o flutter.zip
|
-o flutter.tar.xz
|
||||||
unzip -q flutter.zip
|
tar -xf flutter.tar.xz
|
||||||
export PATH="$PWD/flutter/bin:$PATH"
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
flutter --version
|
flutter --version
|
||||||
echo "$PWD/flutter/bin" >> "$GITHUB_PATH" || echo "$PWD/flutter/bin" >> "$HOME/.env_path"
|
echo "$PWD/flutter/bin" >> "$GITHUB_PATH" || echo "$PWD/flutter/bin" >> "$HOME/.env_path"
|
||||||
@@ -194,15 +193,10 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
- name: Install CocoaPods dependencies
|
- name: Check iOS build feasibility
|
||||||
run: cd ios && pod install --repo-update
|
|
||||||
|
|
||||||
- name: Build iOS (release, no-codesign)
|
|
||||||
run: flutter build ios --release --no-codesign
|
|
||||||
|
|
||||||
- name: "Note: iOS artifact storage not configured"
|
|
||||||
run: |
|
run: |
|
||||||
echo "WARNING: Gitea Actions artifact storage is not configured on this instance."
|
# iOS builds require macOS + Xcode. Our self-hosted runner runs Linux
|
||||||
echo "iOS build outputs available in runner workspace:"
|
# containers via act, so we can natively build iOS only when running
|
||||||
echo " build/ios/iphoneos/"
|
# directly on the Mac host. Skip gracefully here.
|
||||||
echo "Configure artifact storage in Gitea Actions admin settings to enable uploads."
|
echo "SKIP: iOS build requires macOS host with Xcode."
|
||||||
|
echo "To enable iOS builds, run this job natively on the Mac host."
|
||||||
|
|||||||
Reference in New Issue
Block a user