-
Notifications
You must be signed in to change notification settings - Fork 1
183 lines (148 loc) · 4.85 KB
/
build-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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
name: Build and Release app
on:
push:
tags: ["v*.*.*"]
workflow_dispatch:
permissions:
contents: write
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
# - name: Decode Keystore
# run: |
# echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/keystore.jks
# - name: Create key.properties
# run: |
# echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" > android/key.properties
# echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
# echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
# echo "storeFile=keystore.jks" >> android/key.properties
- name: Build Android apps
run: |
flutter pub get
flutter build apk --split-per-abi
flutter build appbundle
- name: Save android packages
uses: actions/upload-artifact@v4
with:
name: android
path: |
build/app/outputs/flutter-apk/*
build/app/outputs/bundle/release/*
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Build Windows
run: |
flutter config --enable-windows-desktop
flutter pub get
flutter build windows --release
- name: Save Windows app
uses: actions/upload-artifact@v4
with:
name: win
path: build\windows\x64\runner\Release\*
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Install devtools
run: |
sudo apt-get update -y
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
sudo apt-get install libwebkit2gtk-4.1-dev
sudo apt-get install curl libcurl4-openssl-dev
sudo apt-get install libayatana-appindicator3-dev
- name: Build Linux
run: |
flutter config --enable-linux-desktop
flutter pub get
flutter build linux --release
- name: Save Linux bundle
uses: actions/upload-artifact@v4
with:
name: linux
path: |
build/linux/x64/release/bundle/*
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Install CocoaPods
run: |
sudo gem install cocoapods
- name: Build macOS
run: |
flutter config --enable-macos-desktop
flutter pub get
pod install --project-directory=macos
flutter build macos --release
- name: Save macOS app
uses: actions/upload-artifact@v4
with:
name: macos
path: build/macos/Build/Products/Release/*.app
release:
runs-on: ubuntu-latest
needs: [build-android, build-windows, build-linux, build-macos]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get all build outputs
uses: actions/download-artifact@v4
with:
path: exec/
- name: Zip Windows programs
run: 7z a -tZip SyncVault-${{ github.ref_name }}-windows.zip exec/win
- name: Zip Linux bundle
run: tar -czvf SyncVault-${{ github.ref_name }}-linux.tar.gz exec/linux
- name: Zip macOS app
run: tar -czvf SyncVault-${{ github.ref_name }}-macos.tar.gz exec/macos
- name: Display structure of downloaded files
run: tree exec/
- name: Create release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: SyncVault
prerelease: true
generate_release_notes: true
files: |
exec/android/bundle/release/app-release.aab
exec/android/flutter-apk/*
SyncVault-${{ github.ref_name }}-windows.zip
SyncVault-${{ github.ref_name }}-linux.tar.gz
SyncVault-${{ github.ref_name }}-macos.tar.gz
body_path: CHANGELOG.md
token: ${{ secrets.GITHUB_TOKEN }}
env:
GITHUB_REPOSITORY: dhzdhd/SyncVault