pubspec.yaml now pins environment.flutter to 3.47.9, so pub get refuses other SDKs. Every CI job reads that pin via flutter-version-file, including the web deploy (was 3.41.2). The AppImage SDK pin moves to 3.47.9 and CI fails if it drifts from pubspec. The Nix shell no longer bundles Flutter, since nixpkgs only packages 3.47.4; it warns when the SDK on PATH is missing or the wrong version.
201 lines
8.6 KiB
YAML
201 lines
8.6 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
android:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: "temurin"
|
|
java-version: "17"
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version-file: pubspec.yaml
|
|
cache: true
|
|
- name: Cache Gradle
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('android/gradle/wrapper/gradle-wrapper.properties', 'android/build.gradle', 'android/settings.gradle', 'android/app/build.gradle', 'pubspec.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
- run: flutter pub get
|
|
- run: flutter build apk --release --no-pub
|
|
|
|
ios:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version-file: pubspec.yaml
|
|
cache: true
|
|
- run: flutter pub get
|
|
- run: flutter build ios --release --no-codesign --no-pub
|
|
|
|
linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Read Linux SDK pin
|
|
id: linux-sdk
|
|
run: echo "version=$(jq -r '.flutter.version' scripts/appimage-tools.json)" >> "$GITHUB_OUTPUT"
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: ${{ steps.linux-sdk.outputs.version }}
|
|
cache: true
|
|
- name: Install Linux build deps
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang cmake ninja-build pkg-config jq libgtk-3-dev librsvg2-dev libgirepository1.0-dev libgtk-3-bin libgdk-pixbuf2.0-bin libgdk-pixbuf-2.0-dev dpkg-dev patchelf file desktop-file-utils xdg-user-dirs shellcheck libssl-dev libunwind-dev libvulkan-dev libgl1-mesa-dev libasound2-dev libsecret-1-dev
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/meshcore-open/appimage
|
|
key: linux-appimage-x86_64-${{ hashFiles('scripts/appimage-tools.json') }}
|
|
- name: Test packaging contracts
|
|
run: |
|
|
shellcheck scripts/build_appimage.sh scripts/appimage/*.sh scripts/appimage/AppRun
|
|
bash scripts/appimage/test_packaging.sh
|
|
- run: flutter pub get
|
|
- run: flutter build linux --release --no-pub
|
|
- uses: docker/setup-buildx-action@v3
|
|
- name: Read AppImage base image
|
|
id: appimage-base
|
|
run: echo "image=$(jq -r '.ubuntu' scripts/appimage-tools.json)" >> "$GITHUB_OUTPUT"
|
|
- name: Build cached x86_64 runtime test image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: scripts
|
|
file: scripts/appimage/Dockerfile
|
|
target: runtime-test
|
|
platforms: linux/amd64
|
|
build-args: |
|
|
BASE_IMAGE=${{ steps.appimage-base.outputs.image }}
|
|
tags: meshcore-appimage-runtime:ci
|
|
cache-from: type=gha,scope=meshcore-appimage-runtime-amd64
|
|
cache-to: type=gha,mode=max,scope=meshcore-appimage-runtime-amd64
|
|
load: true
|
|
- name: Test AppImage in clean Ubuntu
|
|
run: |
|
|
mkdir -p build/appimage-runtime
|
|
docker run --rm --stop-timeout 15 --user "$(id -u):$(id -g)" --mount "type=bind,source=$PWD/build/linux/x64/release/meshcore-open-x86_64.AppImage,target=/artifact.AppImage,readonly" --mount "type=bind,source=$PWD/scripts/appimage/test_runtime.sh,target=/test_runtime.sh,readonly" --mount "type=bind,source=$PWD/build/appimage-runtime,target=/results" meshcore-appimage-runtime:ci timeout --verbose --signal=TERM --kill-after=15s 300s xvfb-run -a bash /test_runtime.sh /artifact.AppImage /results
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: linux-x86_64-appimage
|
|
path: |
|
|
build/linux/x64/release/meshcore-open-x86_64.AppImage
|
|
build/linux/x64/release/appimage-audit.txt
|
|
build/linux/x64/release/appimage-tools.json
|
|
build/appimage-runtime/
|
|
if-no-files-found: warn
|
|
|
|
linux-arm64:
|
|
runs-on: ubuntu-24.04-arm
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Read Flutter source pin
|
|
id: flutter-arm
|
|
run: echo "revision=$(jq -r '.flutter.source_revision' scripts/appimage-tools.json)" >> "$GITHUB_OUTPUT"
|
|
- name: Set up pinned native Flutter SDK
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: main
|
|
flutter-version: ${{ steps.flutter-arm.outputs.revision }}
|
|
architecture: arm64
|
|
git-source: https://github.com/flutter/flutter.git
|
|
cache: true
|
|
- name: Verify native ARM64 Flutter
|
|
env:
|
|
FLUTTER_REVISION: ${{ steps.flutter-arm.outputs.revision }}
|
|
run: |
|
|
test "$(uname -m)" = aarch64
|
|
mkdir -p build
|
|
flutter --version
|
|
flutter --version --machine > build/flutter-version.json
|
|
jq -e --arg revision "$FLUTTER_REVISION" --arg version "$(jq -r '.flutter.version' scripts/appimage-tools.json)" '.frameworkVersion == $version and .frameworkRevision == $revision' build/flutter-version.json
|
|
- name: Install Linux build deps
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y clang cmake ninja-build pkg-config jq libgtk-3-dev librsvg2-dev libgirepository1.0-dev libgtk-3-bin libgdk-pixbuf2.0-bin libgdk-pixbuf-2.0-dev dpkg-dev patchelf file desktop-file-utils xdg-user-dirs shellcheck libssl-dev libunwind-dev libvulkan-dev libgl1-mesa-dev libasound2-dev libsecret-1-dev
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/meshcore-open/appimage
|
|
key: linux-appimage-aarch64-${{ hashFiles('scripts/appimage-tools.json') }}
|
|
- name: Test packaging contracts
|
|
run: |
|
|
shellcheck scripts/build_appimage.sh scripts/appimage/*.sh scripts/appimage/AppRun
|
|
bash scripts/appimage/test_packaging.sh
|
|
- run: flutter pub get
|
|
- run: flutter test --reporter expanded
|
|
- name: Build ARM64 Linux release
|
|
run: |
|
|
if ! flutter build linux --release --no-pub --verbose > build/linux-arm64-build.log 2>&1; then
|
|
tail -n 200 build/linux-arm64-build.log
|
|
exit 1
|
|
fi
|
|
- uses: docker/setup-buildx-action@v3
|
|
- name: Read AppImage base image
|
|
id: appimage-base
|
|
run: echo "image=$(jq -r '.ubuntu' scripts/appimage-tools.json)" >> "$GITHUB_OUTPUT"
|
|
- name: Build cached ARM64 runtime test image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: scripts
|
|
file: scripts/appimage/Dockerfile
|
|
target: runtime-test
|
|
platforms: linux/arm64
|
|
build-args: |
|
|
BASE_IMAGE=${{ steps.appimage-base.outputs.image }}
|
|
tags: meshcore-appimage-runtime-arm64:ci
|
|
cache-from: type=gha,scope=meshcore-appimage-runtime-arm64
|
|
cache-to: type=gha,mode=max,scope=meshcore-appimage-runtime-arm64
|
|
load: true
|
|
- name: Test ARM64 AppImage in clean Ubuntu
|
|
run: |
|
|
mkdir -p build/appimage-runtime
|
|
docker run --rm --stop-timeout 15 --platform linux/arm64 --user "$(id -u):$(id -g)" --mount "type=bind,source=$PWD/build/linux/arm64/release/meshcore-open-aarch64.AppImage,target=/artifact.AppImage,readonly" --mount "type=bind,source=$PWD/scripts/appimage/test_runtime.sh,target=/test_runtime.sh,readonly" --mount "type=bind,source=$PWD/build/appimage-runtime,target=/results" meshcore-appimage-runtime-arm64:ci timeout --verbose --signal=TERM --kill-after=15s 300s xvfb-run -a bash /test_runtime.sh /artifact.AppImage /results
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: linux-arm64-appimage
|
|
path: |
|
|
build/linux/arm64/release/meshcore-open-aarch64.AppImage
|
|
build/linux/arm64/release/appimage-audit.txt
|
|
build/linux/arm64/release/appimage-tools.json
|
|
build/flutter-version.json
|
|
build/appimage-runtime/
|
|
build/linux-arm64-build.log
|
|
if-no-files-found: warn
|
|
|
|
macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version-file: pubspec.yaml
|
|
cache: true
|
|
- run: flutter pub get
|
|
- run: flutter build macos --release --no-pub
|
|
|
|
web:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version-file: pubspec.yaml
|
|
cache: true
|
|
- run: flutter pub get
|
|
- run: flutter build web --release --no-pub
|