-
Notifications
You must be signed in to change notification settings - Fork 3
199 lines (190 loc) · 6.28 KB
/
canary.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
name: Canary Release
on: push
jobs:
android:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup | Java
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "17"
- name: Setup | Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
- name: Setup | Dependencies
run: |
flutter pub get
dart pub global activate flutterfire_cli
- name: Setup | Android NDK
run: |
# /usr/include/bits
sudo apt update -y
sudo apt install libc6-dev-i386
# Install rust targets
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
rustup update
# Install cargo-ndk
# cargo install cargo-ndk
# cd annix
# cargo ndk -o ../android/app/src/main/jniLibs build
# cd ..
- name: Setup | Keystore
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > keystore.jks
echo "${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}" | base64 -d > ./android/keystore.properties
- name: Build | Apk
run: flutter build apk --verbose --split-per-abi
- name: Deploy | Upload artifacts
uses: actions/upload-artifact@v3
with:
name: annix-android
path: |
./build/app/outputs/apk/release/*.apk
retention-days: 1
linux:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup | Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
- name: Setup | Dependencies
run: |
sudo apt update -y
sudo apt install -y libunwind-dev libasound2-dev
sudo apt install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libjsoncpp-dev
rustup update
flutter config --enable-linux-desktop
flutter pub get
dart pub global activate flutterfire_cli
- name: Build | Linux
run: |
flutter build linux --verbose
cd build/linux/x64/release/
zip -r annix-linux64.zip bundle
- name: Deploy | Upload artifacts
uses: actions/upload-artifact@v3
with:
name: annix-linux64
path: ./build/linux/x64/release/annix-linux64.zip
retention-days: 1
macOS:
runs-on: macos-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup | Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
- name: Setup | Dependencies
run: |
rustup target add x86_64-apple-darwin aarch64-apple-darwin
rustup update
flutter pub get
dart pub global activate flutterfire_cli
- name: Build | macOS
run: |
flutter build macos --verbose
cd build/macos/Build/Products/Release
ditto -c -k --sequesterRsrc --keepParent Annix.app annix-macos.zip
- name: Deploy | Upload artifacts
uses: actions/upload-artifact@v3
with:
name: annix-macos
path: |
./build/macos/Build/Products/Release/annix-macos.zip
retention-days: 1
windows:
runs-on: windows-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup | Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
- name: Setup | Dependencies
run: |
rustup update
flutter config --enable-windows-desktop
flutter pub get
dart pub global activate flutterfire_cli
- name: Build | Windows
run: |
flutter build windows --verbose
cp -r build/windows/x64/runner/Release annix-win64
tar.exe -a -c -f annix-win64.zip annix-win64
- name: Deploy | Upload artifacts
uses: actions/upload-artifact@v3
with:
name: annix-win64
path: |
./annix-win64.zip
retention-days: 1
iOS:
runs-on: macos-latest
env:
KEYCHAIN: job-${{ github.job }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup | Flutter
uses: subosito/flutter-action@v2
with:
channel: beta
- name: Setup | Dependencies
run: |
rustup target add x86_64-apple-darwin aarch64-apple-darwin
rustup update
flutter pub get
dart pub global activate flutterfire_cli
- name: Build | iOS
run: |
flutter build ios --no-codesign --verbose --build-number ${{ github.run_number }}
cp -r build/ios/iphoneos Payload
zip -r annix-ios.zip Payload
mv annix-ios.zip annix-ios.ipa
- name: Deploy | Upload artifacts
uses: actions/upload-artifact@v3
with:
name: annix-ios
path: ./annix-ios.ipa
retention-days: 1
publish:
if: ${{ github.ref == 'refs/heads/master' }}
needs: [android, linux, macOS, windows, iOS]
runs-on: ubuntu-20.04
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Install dependencies
run: sudo apt update && sudo apt install -y gettext-base
- run: |
(echo 'SUBJECT=Annix development (canary) build') >> $GITHUB_ENV
gh release delete canary --yes || true
git push origin :canary || true
- name: Publish release
run: |
gh release create canary --prerelease --title "$SUBJECT" --target $GITHUB_SHA annix-android/*.apk annix-linux64/* annix-macos/* annix-win64/* annix-ios/*