-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (127 loc) · 4.43 KB
/
flutter-build.yml
File metadata and controls
131 lines (127 loc) · 4.43 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build ThingSet App
on: push
jobs:
linux-android:
name: Linux & Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
- uses: subosito/flutter-action@v2.21.0
with:
channel: "stable"
flutter-version: "3.32.x"
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
flutter pub get
- name: Build Linux app
run: |
flutter config --enable-linux-desktop
flutter build linux --release
tar -cjvf thingset-app_${{github.ref_name}}-linux.tar.bz2 -C build/linux/x64/release/bundle .
- name: Build Android app
run: |
mkdir android/.keystore
echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 --decode > android/.keystore/upload-keystore.jks
echo "${{ secrets.ANDROID_KEY_PROPERTIES }}" | base64 --decode > android/key.properties
flutter build apk
flutter build appbundle
cp build/app/outputs/flutter-apk/app-release.apk thingset-app_${{github.ref_name}}.apk
cp build/app/outputs/bundle/release/app-release.aab thingset-app_${{github.ref_name}}.aab
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: thingset-app-linux
path: build/linux/x64/release/bundle/*
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: thingset-app-android
path: |
thingset-app_*.apk
thingset-app_*.aab
- name: Upload release files
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
thingset-app_*.apk
thingset-app_*.aab
thingset-app_*-linux.tar.bz2
windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.21.0
with:
channel: "stable"
flutter-version: "3.32.x"
- name: Install dependencies
run: flutter pub get
- name: Build Windows app
run: |
flutter config --enable-windows-desktop
flutter build windows --release
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: thingset-app-windows
path: build/windows/x64/runner/Release/*
- name: Archive release
uses: thedoctor0/zip-release@master
with:
type: "zip"
filename: thingset-app_${{github.ref_name}}-windows.zip
directory: build/windows/x64/runner/Release
- name: Upload release files
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: build/windows/x64/runner/Release/thingset-app_${{github.ref_name}}-windows.zip
# macos-ios:
# name: macOS & iOS
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v4
# - uses: subosito/flutter-action@v2.21.0
# with:
# channel: 'stable'
# flutter-version: '3.32.x'
# architecture: x64
# - name: Install dependencies
# run: flutter pub get
# - name: Build macOS app
# run: |
# flutter config --enable-macos-desktop
# flutter build macos --release
# - name: Build iOS app
# run: |
# flutter build ios --release --no-codesign
# - name: Upload macOS artifacts
# uses: actions/upload-artifact@v4
# with:
# name: thingset-app-macos
# path: build/macos/Build/Products/Release/*
# - name: Archive Release
# uses: thedoctor0/zip-release@master
# with:
# type: 'zip'
# filename: thingset-app_${{github.ref_name}}-macos.zip
# directory: build/macos/Build/Products/Release
# - name: macOS Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# files: build/macos/Build/Products/Release/thingset-app_${{github.ref_name}}-macos.zip