-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (76 loc) · 3.06 KB
/
flutter_build.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
# See: https://flutter.dev/desktop#distribution
# REF: https://github.com/google/flutter-desktop-embedding/blob/master/.github/workflows/ci.yml
name: Flutter Build
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
flutter_build_desktop_app:
runs-on: ${{ matrix.runner_machine }}
timeout-minutes: 20
strategy:
fail-fast: false # I want results from all OSes even if one fails.
matrix:
os: [ubuntu, windows, macos]
include: # See: https://docs.github.com/ja/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-environment-variables-in-a-matrix
- os: ubuntu
runner_machine: ubuntu-latest
subcommand: linux
setup_for_flutter_desktop_script: .github/scripts/linux/install_additional_requirements_for_flutter.sh
prepare_to_pack_script: .github/scripts/linux/prepare_to_pack.sh
distribution_path: build/linux/x64/release
- os: windows
runner_machine: windows-latest
subcommand: windows
setup_for_flutter_desktop_script: .github/scripts/windows/install_additional_requirements_for_flutter.sh
prepare_to_pack_script: .github/scripts/windows/prepare_to_pack.sh
distribution_path: build/windows/runner/Release
- os: macos
runner_machine: macos-latest
subcommand: macos
setup_for_flutter_desktop_script: .github/scripts/macos/install_additional_requirements_for_flutter.sh
prepare_to_pack_script: .github/scripts/macos/prepare_to_pack.sh
distribution_path: build/macos/Build/Products/release
steps:
- uses: actions/checkout@v4
- uses: subosito/[email protected]
with:
cache: true
- name: setup flutter channel
shell: bash
run: ./scripts/setup_flutter.sh
- name: setup flutter desktop
shell: bash
run: ${{ matrix.setup_for_flutter_desktop_script }}
- name: doctor
run: flutter doctor -v
- name: install dependencies
run: flutter pub get
- name: build
run: flutter build ${{ matrix.subcommand }} --release --dart-define SENTRY_DSN=${{ secrets.SENTRY_DSN }}
- name: prepare to pack
shell: bash
run: ${{ matrix.prepare_to_pack_script }}
# - name: debug
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# - name: set output path
# shell: bash
# run: |-
# path=$(echo ${{ matrix.distribution_path }} | sed -e 's/_mode_/${{ matrix.mode }}/g')
# echo "artifact_target=$path" >> $GITHUB_ENV
- name: output build info
shell: bash
run: .github/scripts/output_build_info.sh ${{ matrix.distribution_path }}
- name: diff check
run: git diff --exit-code
- uses: actions/upload-artifact@v3
with:
name: pedax-${{ runner.os }}
path: ${{ matrix.distribution_path }}