-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (109 loc) · 2.91 KB
/
publish.yml
File metadata and controls
116 lines (109 loc) · 2.91 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
name: Publish
on:
push:
tags:
- '*'
jobs:
android:
name: "Publish Android"
runs-on: "ubuntu-latest"
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g"
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- run: flutter pub get
- run: flutter build apk
- run: flutter build appbundle
- uses: actions/upload-artifact@v4
with:
name: android
path: build/app/outputs/flutter-apk/app-release.apk
- uses: actions/upload-artifact@v4
with:
name: android_bundle
path: build/app/outputs/bundle/release/app.aab
web:
runs-on: "ubuntu-latest"
name: "Publish Web"
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- run: flutter build web
- uses: actions/upload-artifact@v4
with:
name: web
path: build/web/
linux:
name: "Publish Linux"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: sudo apt-get update -y && sudo apt-get install -y ninja-build libgtk-3-dev libsecret-1-dev
- run: flutter pub get
- run: flutter build linux
- uses: actions/upload-artifact@v4
with:
name: linux_x64
path: build/linux/x64/release/bundle/
windows:
runs-on: windows-latest
name: "Publish Windows"
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- run: flutter build windows
- uses: actions/upload-artifact@v4
with:
name: windows_x64
path: build/windows/x64/runner/Release/
macos:
name: "Publish macOS"
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- run: flutter build macos
- uses: actions/upload-artifact@v4
with:
name: macos
path: build/macos/Build/Products/Release/*.app
release:
name: "Create Release"
needs: [android, web, linux, windows, macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Archive artifacts
run: |
cd artifacts
for dir in */; do
name="${dir%/}"
zip -r "../${name}.zip" "$dir"
done
- uses: softprops/action-gh-release@v2
with:
files: "*.zip"
generate_release_notes: true