Add build-macos and build-windows CI jobs that run flutter build for each platform after the main check suite passes on main. Both jobs use FVM to install the pinned Flutter version and run codegen before building. They require platform-specific runners labelled 'macos-latest' / 'windows-latest'; the jobs are skipped automatically if no matching runner is registered. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
109 lines
2.9 KiB
YAML
109 lines
2.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
check:
|
|
name: Full Project Check
|
|
# Match the label of your self-hosted runner
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Enable Nix flakes
|
|
run: |
|
|
mkdir -p ~/.config/nix
|
|
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
|
|
|
|
- name: Run Full Check Suite
|
|
# Using nix develop ensures the runner doesn't need flutter/dart/stalwart installed globally.
|
|
# 'task check' runs analyze, unit tests, widget tests, and integration tests.
|
|
run: nix develop --command task check
|
|
|
|
build-linux:
|
|
name: Build Linux Release
|
|
runs-on: self-hosted
|
|
needs: check
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Enable Nix flakes
|
|
run: |
|
|
mkdir -p ~/.config/nix
|
|
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
|
|
|
|
- name: Build Linux
|
|
run: nix develop --command task build-linux-release
|
|
|
|
build-macos:
|
|
name: Build macOS Debug
|
|
runs-on: macos-latest
|
|
needs: check
|
|
if: github.ref == 'refs/heads/main'
|
|
# Requires a macOS runner labelled 'macos-latest'.
|
|
# Jobs are skipped automatically when no matching runner is registered.
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install FVM
|
|
run: dart pub global activate fvm
|
|
|
|
- name: Install Flutter via FVM
|
|
run: |
|
|
fvm install --skip-pub-get
|
|
fvm use --skip-pub-get
|
|
|
|
- name: Pub get
|
|
run: fvm flutter pub get --suppress-analytics
|
|
|
|
- name: Generate code
|
|
run: fvm flutter pub run build_runner build
|
|
|
|
- name: Generate changelog
|
|
run: |
|
|
mkdir -p assets
|
|
git log -n 50 --pretty=format:"* %ad [%h](https://codeberg.org/guettli/sharedinbox/commit/%H): %s" --date=short > assets/changelog.txt
|
|
|
|
- name: Build macOS
|
|
run: fvm flutter build macos --debug --no-pub
|
|
|
|
build-windows:
|
|
name: Build Windows Debug
|
|
runs-on: windows-latest
|
|
needs: check
|
|
if: github.ref == 'refs/heads/main'
|
|
# Requires a Windows runner labelled 'windows-latest'.
|
|
# Jobs are skipped automatically when no matching runner is registered.
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install FVM
|
|
run: dart pub global activate fvm
|
|
|
|
- name: Install Flutter via FVM
|
|
run: |
|
|
fvm install --skip-pub-get
|
|
fvm use --skip-pub-get
|
|
|
|
- name: Pub get
|
|
run: fvm flutter pub get --suppress-analytics
|
|
|
|
- name: Generate code
|
|
run: fvm flutter pub run build_runner build
|
|
|
|
- name: Generate changelog
|
|
run: |
|
|
mkdir -p assets
|
|
git log -n 50 "--pretty=format:* %ad [%h](https://codeberg.org/guettli/sharedinbox/commit/%H): %s" --date=short > assets/changelog.txt
|
|
|
|
- name: Build Windows
|
|
run: fvm flutter build windows --debug --no-pub
|