-
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (64 loc) · 2.01 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
flutter-cmd: linux
artifact: build/linux/x64/release/bundle
platform: Linux
- os: ubuntu-latest
flutter-cmd: apk
artifact: build/app/outputs/flutter-apk/app-release.apk
platform: Android
- os: windows-latest
flutter-cmd: windows
artifact: build/windows/x64/runner/Release
platform: Windows
- os: macos-latest
flutter-cmd: macos
artifact: build/macos/Build/Products/Release/daily_wallpaper_images.app
platform: MacOS
runs-on: ${{ matrix.os }}
name: ${{ matrix.platform }} build
steps:
# setup env
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Build Env
uses: ./.github/setup-rinf
with:
platform: ${{ matrix.platform }}
cache-cargo: true
cache-cargo-key: ${{ hashFiles('Cargo.lock') }}-${{ matrix.platform }}-cargo
cache-pub: true
cache-pub-key: ${{ hashFiles('pubspec.lock') }}-${{ matrix.platform }}-dart
cache-flutter-sdk: true
# lint and build
- name: Generate messages API
run: rinf message
- name: Get Flutter dependencies
run: flutter pub get
- name: Lint Dart sources
run: flutter analyze
- name: Lint Rust sources
run: cargo clippy
# Generated Rust code is unformatted: https://github.com/cunarist/rinf/issues/500
# - name: Format Rust sources
# run: cargo fmt --check
- name: Build App
run: flutter build ${{ matrix.flutter-cmd }}
- name: Save artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ matrix.artifact }}
name: ${{ matrix.platform }}_artifacts