-
Notifications
You must be signed in to change notification settings - Fork 5
108 lines (90 loc) · 3.08 KB
/
release.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
on:
push:
branches:
- master
name: Flutter App Template Release
jobs:
publish:
strategy:
fail-fast: false
matrix:
toolchain:
- rust: stable
flutter: stable
platform:
- target: x86_64-unknown-linux-gnu
host: ubuntu-latest
format: appimage
artifact: flutter-app-template-x86_64.AppImage
- target: x86_64-apple-darwin
host: macos-latest
format: dmg
#- target: x86_64-pc-windows-msvc
# host: windows-latest
# format: nsis
- target: aarch64-linux-android
host: ubuntu-latest
format: apk
artifact: apk/flutter-app-template.apk
- target: aarch64-apple-ios
host: macos-latest
format: lipo
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
LLVM_CONFIG_PATH: /usr/local/opt/llvm/bin/llvm-config
NDK_HOME: /usr/local/lib/android/sdk/ndk-bundle
runs-on: ${{ matrix.platform.host }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cache cargo folder
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ matrix.platform.target }}-cargo-${{ matrix.toolchain.rust }}
- name: Install dependencies ubuntu
if: matrix.platform.host == 'ubuntu-latest'
run: sudo apt-get install llvm-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Install dependencies macos
if: matrix.platform.host == 'macos-latest'
run: brew install llvm
- name: Install dependencies windows
if: matrix.platform.host == 'windows-latest'
run: choco install llvm
- name: Install appimagetool
if: matrix.platform.format == 'appimage'
run: |
wget https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
sudo mv appimagetool-x86_64.AppImage /usr/bin/appimagetool
- name: Install rust toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.toolchain.rust }}
targets: ${{ matrix.platform.target }}
- name: Install flutter
uses: subosito/flutter-action@v1
with:
channel: ${{ matrix.toolchain.flutter }}
- name: Install cargo-flutter
run: cargo install cargo-flutter --force
- name: Build
run: cargo flutter --quiet --no-sign --format ${{ matrix.platform.format }}
build --target ${{ matrix.platform.target }} --release
- name: Create release
continue-on-error: true
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v_${{ github.sha }}
release_name: Release v_${{ github.sha }}
- name: Upload release asset
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v_${{ github.sha }}
name: Flutter App Template ${{ github.sha }}
files: ./target/flutter/${{ matrix.platform.target }}/release/${{ matrix.platform.artifact }}