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
+14
-13
@@ -2,9 +2,9 @@ FROM --platform=linux/amd64 debian:bookworm-slim
|
|||||||
|
|
||||||
ENV PATH="$PATH:/opt/flutter/bin"
|
ENV PATH="$PATH:/opt/flutter/bin"
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies - minimal set for Flutter + Android builds
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
wget curl unzip git xz-utils zip cmake clang pkg-config mesa-utils python3 pip pipx lld libgtk-3-dev ninja-build libglu1-mesa openjdk-17-jdk\
|
wget curl unzip git xz-utils zip python3 libgtk-3-dev ninja-build openjdk-17-jre-headless \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Become non-root
|
# Become non-root
|
||||||
@@ -12,27 +12,28 @@ ARG USERNAME=vscode
|
|||||||
ARG USER_UID=1000
|
ARG USER_UID=1000
|
||||||
ARG USER_GID=1000
|
ARG USER_GID=1000
|
||||||
|
|
||||||
ENV FLUTTER_VERSION=3.41.8
|
ENV FLUTTER_VERSION=3.44.0
|
||||||
ENV FLUTTER_HOME=/opt/flutter
|
ENV FLUTTER_HOME=/opt/flutter
|
||||||
RUN groupadd --gid $USER_GID $USERNAME \
|
RUN groupadd --gid $USER_GID $USERNAME \
|
||||||
&& useradd --uid $USER_UID --gid $USER_GID -m -s /bin/bash $USERNAME
|
&& useradd --uid $USER_UID --gid $USER_GID -m -s /bin/bash $USERNAME
|
||||||
|
|
||||||
|
# Install Flutter (tarball - much faster than git clone)
|
||||||
# Install Flutter
|
RUN wget -q "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${FLUTTER_VERSION}-stable.tar.xz" \
|
||||||
RUN git clone https://github.com/flutter/flutter.git ${FLUTTER_HOME} \
|
-O /tmp/flutter.tar.xz \
|
||||||
&& cd ${FLUTTER_HOME} \
|
&& tar -xf /tmp/flutter.tar.xz -C /opt \
|
||||||
&& git checkout $FLUTTER_VERSION
|
&& rm /tmp/flutter.tar.xz
|
||||||
|
|
||||||
# Set up Android SDK
|
# Set up Android SDK
|
||||||
ENV ANDROID_HOME=/opt/android-sdk
|
ENV ANDROID_HOME=/opt/android-sdk
|
||||||
ENV PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/36.0.0
|
ENV PATH=${PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools/35.0.0
|
||||||
|
|
||||||
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
|
RUN mkdir -p ${ANDROID_HOME}/cmdline-tools \
|
||||||
&& wget https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip -O commandlinetools.zip \
|
&& wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O commandlinetools.zip \
|
||||||
&& unzip commandlinetools.zip -d ${ANDROID_HOME}/cmdline-tools \
|
&& unzip -q commandlinetools.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 \
|
||||||
&& rm commandlinetools.zip && yes | sdkmanager --licenses \
|
&& rm commandlinetools.zip \
|
||||||
&& sdkmanager "platform-tools" "platforms;android-36" "build-tools;36.0.0"
|
&& yes | sdkmanager --licenses \
|
||||||
|
&& sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0"
|
||||||
RUN chown -R 1000:1000 ${ANDROID_HOME} && chown -R 1000:1000 ${FLUTTER_HOME}
|
RUN chown -R 1000:1000 ${ANDROID_HOME} && chown -R 1000:1000 ${FLUTTER_HOME}
|
||||||
|
|
||||||
USER $USERNAME
|
USER $USERNAME
|
||||||
|
|||||||
+60
-26
@@ -10,9 +10,10 @@
|
|||||||
# Each step is a separate shell. We export PATH="$PWD/flutter/bin:$PATH" in
|
# Each step is a separate shell. We export PATH="$PWD/flutter/bin:$PATH" in
|
||||||
# every step that uses flutter/dart commands.
|
# every step that uses flutter/dart commands.
|
||||||
#
|
#
|
||||||
# subosito/flutter-action works on this runner — use it where possible for
|
# subosito/flutter-action works on some runners but fails on others (e.g.
|
||||||
# caching and speed. For build-android we still need manual JDK + Android SDK
|
# Magrathea). We use a direct Flutter SDK download for reliability across
|
||||||
# setup since actions/setup-java is GitHub-specific.
|
# all runners. For build-android we need manual JDK + Android SDK setup
|
||||||
|
# since actions/setup-java is GitHub-specific.
|
||||||
|
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
@@ -43,23 +44,34 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
run: |
|
||||||
with:
|
set -e
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \
|
||||||
cache: true
|
-o /tmp/flutter.tar.xz
|
||||||
|
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter --version
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: flutter pub get
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
- name: Generate stubs (lint gate support)
|
- name: Generate stubs (lint gate support)
|
||||||
if: hashFiles('theme.json') == ''
|
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
|
- name: Analyze Dart code
|
||||||
run: flutter analyze --fatal-warnings
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter analyze --fatal-warnings
|
||||||
|
|
||||||
- name: Auto-format source
|
- name: Auto-format source
|
||||||
run: dart format lib/ test/
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
dart format lib/ test/
|
||||||
|
|
||||||
|
|
||||||
# ── Stage 1 (parallel): Unit & widget tests ──────────────────────
|
# ── Stage 1 (parallel): Unit & widget tests ──────────────────────
|
||||||
@@ -71,19 +83,28 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
run: |
|
||||||
with:
|
set -e
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \
|
||||||
cache: true
|
-o /tmp/flutter.tar.xz
|
||||||
|
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter --version
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: flutter pub get
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
- name: Generate stubs (lint gate support)
|
- 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
|
- name: Run tests
|
||||||
run: flutter test --reporter=expanded
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter test --reporter=expanded
|
||||||
|
|
||||||
|
|
||||||
# ── Stage 3: Android build ──────────────────────────────────────
|
# ── Stage 3: Android build ──────────────────────────────────────
|
||||||
@@ -107,10 +128,13 @@ jobs:
|
|||||||
java -version
|
java -version
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
run: |
|
||||||
with:
|
set -e
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_${{ env.FLUTTER_VERSION }}-stable.tar.xz" \
|
||||||
cache: true
|
-o /tmp/flutter.tar.xz
|
||||||
|
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter --version
|
||||||
|
|
||||||
- name: Install Android SDK command-line tools
|
- name: Install Android SDK command-line tools
|
||||||
run: |
|
run: |
|
||||||
@@ -125,32 +149,42 @@ jobs:
|
|||||||
sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0"
|
sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0"
|
||||||
|
|
||||||
- name: Pre-cache Android platform artifacts
|
- 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
|
- name: Accept Android SDK licenses
|
||||||
run: |
|
run: |
|
||||||
yes | "${HOME}/android-sdk/cmdline-tools/latest/bin/sdkmanager" --licenses || true
|
yes | "${HOME}/android-sdk/cmdline-tools/latest/bin/sdkmanager" --licenses || true
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: flutter pub get
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
- name: Generate stubs (lint gate support)
|
- name: Generate stubs (lint gate support)
|
||||||
run: python3 ci_stub_gen.py
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
python3 ci_stub_gen.py
|
||||||
|
|
||||||
# Optional: run whitelabel build script to regenerate lib/generated/
|
# Optional: run whitelabel build script to regenerate lib/generated/
|
||||||
# Skip gracefully if theme.json is missing or script fails
|
# Skip gracefully if theme.json is missing or script fails
|
||||||
- name: Run whitelabel build script
|
- name: Run whitelabel build script
|
||||||
if: hashFiles('theme.json') != ''
|
if: hashFiles('theme.json') != ''
|
||||||
run: python3 build_whitelabel.py
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
python3 build_whitelabel.py
|
||||||
|
|
||||||
- name: Build APK (release)
|
- name: Build APK (release)
|
||||||
run: |
|
run: |
|
||||||
export JAVA_HOME="$HOME/jdk"
|
export JAVA_HOME="$HOME/jdk"
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
flutter build apk --release
|
flutter build apk --release
|
||||||
|
|
||||||
- name: Build App Bundle (release)
|
- name: Build App Bundle (release)
|
||||||
run: |
|
run: |
|
||||||
export JAVA_HOME="$HOME/jdk"
|
export JAVA_HOME="$HOME/jdk"
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
flutter build appbundle --release
|
flutter build appbundle --release
|
||||||
|
|
||||||
- name: List build outputs
|
- name: List build outputs
|
||||||
|
|||||||
@@ -22,23 +22,34 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
run: |
|
||||||
with:
|
set -e
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz" \
|
||||||
cache: true
|
-o /tmp/flutter.tar.xz
|
||||||
|
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter --version
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: flutter pub get
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
- name: Generate stubs (lint gate support)
|
- name: Generate stubs (lint gate support)
|
||||||
if: hashFiles('theme.json') == ''
|
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
|
- name: Analyze Dart code
|
||||||
run: flutter analyze --fatal-warnings
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter analyze --fatal-warnings
|
||||||
|
|
||||||
- name: Check formatting
|
- 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) ──────────────────────────────────────────────────
|
# ── Test (gate) ──────────────────────────────────────────────────
|
||||||
@@ -51,19 +62,28 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
run: |
|
||||||
with:
|
set -e
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz" \
|
||||||
cache: true
|
-o /tmp/flutter.tar.xz
|
||||||
|
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter --version
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: flutter pub get
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
- name: Generate stubs (lint gate support)
|
- 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
|
- name: Run tests
|
||||||
run: flutter test --reporter=expanded
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter test --reporter=expanded
|
||||||
|
|
||||||
|
|
||||||
# ── Android release build ───────────────────────────────────
|
# ── Android release build ───────────────────────────────────
|
||||||
@@ -76,40 +96,53 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Java 17
|
- name: Setup Java 17
|
||||||
uses: actions/setup-java@v4
|
run: |
|
||||||
with:
|
set -e
|
||||||
distribution: temurin
|
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" \
|
||||||
java-version: "17"
|
-o /tmp/jdk.tar.gz
|
||||||
cache: gradle
|
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
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
run: |
|
||||||
with:
|
set -e
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz" \
|
||||||
cache: true
|
-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
|
- 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
|
- name: Accept Android SDK licenses
|
||||||
run: |
|
run: |
|
||||||
yes | sdkmanager --licenses || true
|
yes | "${HOME}/android-sdk/cmdline-tools/latest/bin/sdkmanager" --licenses || true
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v5
|
run: |
|
||||||
with:
|
set -e
|
||||||
python-version: "3.12"
|
python3 --version
|
||||||
|
|
||||||
- name: Install Python dependencies
|
- name: Install Python dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip || true
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt || true
|
||||||
|
|
||||||
- name: Install Flutter dependencies
|
- name: Install Flutter dependencies
|
||||||
run: flutter pub get
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
- name: Generate stubs (lint gate support)
|
- 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
|
# If release signing secrets are available, write keystore
|
||||||
# and update build.gradle.kts to use a release signing config.
|
# and update build.gradle.kts to use a release signing config.
|
||||||
@@ -131,10 +164,16 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Build APK (release)
|
- 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)
|
- 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
|
- name: List build outputs
|
||||||
run: |
|
run: |
|
||||||
@@ -143,19 +182,12 @@ jobs:
|
|||||||
echo "=== AAB output ==="
|
echo "=== AAB output ==="
|
||||||
ls -lh build/app/outputs/bundle/release/ || true
|
ls -lh build/app/outputs/bundle/release/ || true
|
||||||
|
|
||||||
- name: Upload APK artifact
|
- name: "Note: artifact storage not configured"
|
||||||
uses: actions/upload-artifact@v4
|
run: |
|
||||||
with:
|
echo "WARNING: Gitea Actions artifact storage is not configured on this instance."
|
||||||
name: release-android-apk
|
echo "Build outputs available in runner workspace:"
|
||||||
path: build/app/outputs/flutter-apk/app-release.apk
|
echo " APK: build/app/outputs/flutter-apk/app-release.apk"
|
||||||
retention-days: 90
|
echo " AAB: build/app/outputs/bundle/release/app-release.aab"
|
||||||
|
|
||||||
- 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
|
|
||||||
|
|
||||||
|
|
||||||
# ── iOS release build ───────────────────────────────────────
|
# ── iOS release build ───────────────────────────────────────
|
||||||
@@ -171,13 +203,18 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Flutter
|
- name: Setup Flutter
|
||||||
uses: subosito/flutter-action@v2
|
run: |
|
||||||
with:
|
set -e
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
curl -fsSL "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.0-stable.tar.xz" \
|
||||||
cache: true
|
-o /tmp/flutter.tar.xz
|
||||||
|
tar -xf /tmp/flutter.tar.xz -C "$PWD"
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter --version
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: flutter pub get
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
- name: Install CocoaPods dependencies
|
- name: Install CocoaPods dependencies
|
||||||
run: cd ios && pod install --repo-update
|
run: cd ios && pod install --repo-update
|
||||||
@@ -210,35 +247,25 @@ jobs:
|
|||||||
|
|
||||||
- name: Build iOS (release)
|
- name: Build iOS (release)
|
||||||
if: env.APPLE_CERTIFICATE_P12 != ''
|
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)
|
- name: Build iOS (release, no-codesign)
|
||||||
if: env.APPLE_CERTIFICATE_P12 == ''
|
if: env.APPLE_CERTIFICATE_P12 == ''
|
||||||
run: flutter build ios --release --no-codesign
|
run: |
|
||||||
|
export PATH="$PWD/flutter/bin:$PATH"
|
||||||
- name: Upload iOS artifact
|
flutter build ios --release --no-codesign
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: release-ios-app
|
|
||||||
path: build/ios/iphoneos/
|
|
||||||
retention-days: 90
|
|
||||||
|
|
||||||
|
|
||||||
# ── Publish Gitea Release ────────────────────────────────────
|
# ── Publish Gitea Release ────────────────────────────────────
|
||||||
publish-release:
|
publish-release:
|
||||||
name: Publish Release
|
name: Publish Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build-android, build-ios]
|
needs: [build-android]
|
||||||
steps:
|
steps:
|
||||||
- name: Download Android APK
|
- name: Checkout
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
name: release-android-apk
|
|
||||||
|
|
||||||
- name: Download Android AAB
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: release-android-aab
|
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
env:
|
env:
|
||||||
@@ -251,27 +278,3 @@ jobs:
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"tag_name\": \"$TAG\", \"name\": \"$TAG\", \"body\": \"Automated release build for $TAG\"}" \
|
-d "{\"tag_name\": \"$TAG\", \"name\": \"$TAG\", \"body\": \"Automated release build for $TAG\"}" \
|
||||||
"$GITEA_BASE/api/v1/repos/kfj001/kryz-go-flutter/releases"
|
"$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