fix(ci): restore reliable Flutter SDK download + fix release.yml token hardcoding
- Revert subosito/flutter-action to direct Flutter SDK download (action was failing on Magrathea runner, works inconsistently across runners) - Fix release.yml: replace 3x hardcoded 'token ***' with $GITEA_TOKEN env var for Gitea release API calls - Fix release.yml: replace GitHub-specific actions (setup-java, setup-python, upload-artifact) with manual SDK downloads - Update Dockerfile: Flutter 3.41.8 -> 3.44.0, tarball instead of git clone, removed unnecessary packages (cmake, clang, pip, pipx, lld, mesa-utils), JRE headless instead of full JDK - Simplify release.yml publish-release: single step to create Gitea release (artifact upload pending storage configuration)
This commit is contained in:
1 parent
270e3e3805
commit
be7c44c4c4
3 files changed
+173
-135
No files matched your search
@@ -22,23 +22,34 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
run: |
|
||||
set -e
|
||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz" \
|
||||
-o /tmp/flutter.tar.xz
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter --version
|
||||
|
||||
- name: Install dependencies
|
||||
run: flutter pub get
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter pub get
|
||||
|
||||
- name: Generate stubs (lint gate support)
|
||||
if: hashFiles('theme.json') == ''
|
||||
run: python3 ci_stub_gen.py
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
python3 ci_stub_gen.py
|
||||
|
||||
- name: Analyze Dart code
|
||||
run: flutter analyze --fatal-warnings
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter analyze --fatal-warnings
|
||||
|
||||
- name: Check formatting
|
||||
run: dart format --set-exit-if-changed lib/ test/
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
dart format --set-exit-if-changed lib/ test/
|
||||
|
||||
|
||||
# ── Test (gate) ──────────────────────────────────────────────────
|
||||
@@ -51,19 +62,28 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
run: |
|
||||
set -e
|
||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz" \
|
||||
-o /tmp/flutter.tar.xz
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter --version
|
||||
|
||||
- name: Install dependencies
|
||||
run: flutter pub get
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter pub get
|
||||
|
||||
- name: Generate stubs (lint gate support)
|
||||
run: python3 ci_stub_gen.py
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
python3 ci_stub_gen.py
|
||||
|
||||
- name: Run tests
|
||||
run: flutter test --reporter=expanded
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter test --reporter=expanded
|
||||
|
||||
|
||||
# ── Android release build ───────────────────────────────────
|
||||
@@ -76,40 +96,53 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Java 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "17"
|
||||
cache: gradle
|
||||
run: |
|
||||
set -e
|
||||
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 /tmp/jdk.tar.gz
|
||||
mkdir -p "$HOME/jdk"
|
||||
tar -xzf /tmp/jdk.tar.gz -C "$HOME/jdk" --strip-components=1
|
||||
export PATH="$HOME/jdk/bin:$PATH"
|
||||
export JAVA_HOME="$HOME/jdk"
|
||||
java -version
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
run: |
|
||||
set -e
|
||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz" \
|
||||
-o /tmp/flutter.tar.xz
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter --version
|
||||
|
||||
- name: Pre-cache Android platform artifacts
|
||||
run: flutter precache --android
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter precache --android
|
||||
|
||||
- name: Accept Android SDK licenses
|
||||
run: |
|
||||
yes | sdkmanager --licenses || true
|
||||
yes | "${HOME}/android-sdk/cmdline-tools/latest/bin/sdkmanager" --licenses || true
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
run: |
|
||||
set -e
|
||||
python3 --version
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
python3 -m pip install --upgrade pip || true
|
||||
pip install -r requirements.txt || true
|
||||
|
||||
- name: Install Flutter dependencies
|
||||
run: flutter pub get
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter pub get
|
||||
|
||||
- name: Generate stubs (lint gate support)
|
||||
run: python3 ci_stub_gen.py
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
python3 ci_stub_gen.py
|
||||
|
||||
# If release signing secrets are available, write keystore
|
||||
# and update build.gradle.kts to use a release signing config.
|
||||
@@ -131,10 +164,16 @@ jobs:
|
||||
EOF
|
||||
|
||||
- name: Build APK (release)
|
||||
run: flutter build apk --release
|
||||
run: |
|
||||
export JAVA_HOME="$HOME/jdk"
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter build apk --release
|
||||
|
||||
- name: Build App Bundle (release)
|
||||
run: flutter build appbundle --release
|
||||
run: |
|
||||
export JAVA_HOME="$HOME/jdk"
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter build appbundle --release
|
||||
|
||||
- name: List build outputs
|
||||
run: |
|
||||
@@ -143,19 +182,12 @@ jobs:
|
||||
echo "=== AAB output ==="
|
||||
ls -lh build/app/outputs/bundle/release/ || true
|
||||
|
||||
- name: Upload APK artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-android-apk
|
||||
path: build/app/outputs/flutter-apk/app-release.apk
|
||||
retention-days: 90
|
||||
|
||||
- name: Upload AAB artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-android-aab
|
||||
path: build/app/outputs/bundle/release/app-release.aab
|
||||
retention-days: 90
|
||||
- name: "Note: artifact storage not configured"
|
||||
run: |
|
||||
echo "WARNING: Gitea Actions artifact storage is not configured on this instance."
|
||||
echo "Build outputs available in runner workspace:"
|
||||
echo " APK: build/app/outputs/flutter-apk/app-release.apk"
|
||||
echo " AAB: build/app/outputs/bundle/release/app-release.aab"
|
||||
|
||||
|
||||
# ── iOS release build ───────────────────────────────────────
|
||||
@@ -171,13 +203,18 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||
cache: true
|
||||
run: |
|
||||
set -e
|
||||
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz" \
|
||||
-o /tmp/flutter.tar.xz
|
||||
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter --version
|
||||
|
||||
- name: Install dependencies
|
||||
run: flutter pub get
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter pub get
|
||||
|
||||
- name: Install CocoaPods dependencies
|
||||
run: cd ios && pod install --repo-update
|
||||
@@ -210,35 +247,25 @@ jobs:
|
||||
|
||||
- name: Build iOS (release)
|
||||
if: env.APPLE_CERTIFICATE_P12 != ''
|
||||
run: flutter build ios --release
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter build ios --release
|
||||
|
||||
- name: Build iOS (release, no-codesign)
|
||||
if: env.APPLE_CERTIFICATE_P12 == ''
|
||||
run: flutter build ios --release --no-codesign
|
||||
|
||||
- name: Upload iOS artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-ios-app
|
||||
path: build/ios/iphoneos/
|
||||
retention-days: 90
|
||||
run: |
|
||||
export PATH="$PWD/flutter/bin:$PATH"
|
||||
flutter build ios --release --no-codesign
|
||||
|
||||
|
||||
# ── Publish Gitea Release ────────────────────────────────────
|
||||
publish-release:
|
||||
name: Publish Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-android, build-ios]
|
||||
needs: [build-android]
|
||||
steps:
|
||||
- name: Download Android APK
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-android-apk
|
||||
|
||||
- name: Download Android AAB
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: release-android-aab
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Create Gitea Release
|
||||
env:
|
||||
@@ -251,27 +278,3 @@ jobs:
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\": \"$TAG\", \"name\": \"$TAG\", \"body\": \"Automated release build for $TAG\"}" \
|
||||
"$GITEA_BASE/api/v1/repos/kfj001/kryz-go-flutter/releases"
|
||||
|
||||
- name: Upload APK to Release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
TAG: ${{ gitea.ref_name }}
|
||||
GITEA_BASE: https://git.westerntechnologies.duckdns.org
|
||||
run: |
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/vnd.android.package-archive" \
|
||||
--data-binary @app-release.apk \
|
||||
"$GITEA_BASE/api/v1/repos/kfj001/kryz-go-flutter/releases/assets?name=app-release.apk&tag_name=$TAG"
|
||||
|
||||
- name: Upload AAB to Release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
TAG: ${{ gitea.ref_name }}
|
||||
GITEA_BASE: https://git.westerntechnologies.duckdns.org
|
||||
run: |
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @app-release.aab \
|
||||
"$GITEA_BASE/api/v1/repos/kfj001/kryz-go-flutter/releases/assets?name=app-release.aab&tag_name=$TAG"
|
||||
Reference in new issue
Block a user