-
Notifications
You must be signed in to change notification settings - Fork 19
86 lines (83 loc) · 3.2 KB
/
test_example_plugin_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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
on:
pull_request:
push:
branches:
- main
name: Test Example Plugin
jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
build_mode:
- debug
- profile
- release
env:
EXAMPLE_DIR: "a b/hello_rust_ffi_plugin/example"
CARGOKIT_VERBOSE: 1
steps:
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Setup Repository
shell: bash
run: |
mkdir "a b" # Space is intentional
cd "a b"
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
# "advanced" branch has extra iOS flavor and uses rust nightly for release builds
git clone -b advanced https://github.com/irondash/hello_rust_ffi_plugin
cd hello_rust_ffi_plugin
git subtree pull --prefix cargokit https://github.com/${{ github.event.pull_request.head.repo.full_name || github.repository }} ${{ steps.extract_branch.outputs.branch }} --squash
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.0
with:
channel: "stable"
- name: Install GTK
if: (matrix.os == 'ubuntu-latest')
run: sudo apt-get update && sudo apt-get install libgtk-3-dev
- name: Install ninja-build
if: (matrix.os == 'ubuntu-latest')
run: sudo apt-get update && sudo apt-get install ninja-build
- name: Build Linux (${{ matrix.build_mode }})
if: matrix.os == 'ubuntu-latest'
shell: bash
working-directory: ${{ env.EXAMPLE_DIR }}
run: flutter build linux --${{ matrix.build_mode }} -v
- name: Build macOS (${{ matrix.build_mode }})
if: matrix.os == 'macos-latest'
shell: bash
working-directory: ${{ env.EXAMPLE_DIR }}
run: flutter build macos --${{ matrix.build_mode }} -v
- name: Build iOS (${{ matrix.build_mode }})
if: matrix.os == 'macos-latest'
shell: bash
working-directory: ${{ env.EXAMPLE_DIR }}
run: flutter build ios --${{ matrix.build_mode }} --no-codesign -v
- name: Build iOS (${{ matrix.build_mode }}) - flavor1
if: matrix.os == 'macos-latest'
shell: bash
working-directory: ${{ env.EXAMPLE_DIR }}
run: flutter build ios --flavor flavor1 --${{ matrix.build_mode }} --no-codesign -v
- name: Build Windows (${{ matrix.build_mode }})
if: matrix.os == 'windows-latest'
shell: bash
working-directory: ${{ env.EXAMPLE_DIR }}
run: flutter build windows --${{ matrix.build_mode }} -v
- name: Build Android (${{ matrix.build_mode }})
shell: bash
working-directory: ${{ env.EXAMPLE_DIR }}
run: |
if [[ $(sysctl hw.optional.arm64) == *"hw.optional.arm64: 1"* ]]; then
export JAVA_HOME=$JAVA_HOME_17_arm64
else
export JAVA_HOME=$JAVA_HOME_11_X64
fi
flutter build apk --${{ matrix.build_mode }} -v