-
Notifications
You must be signed in to change notification settings - Fork 43
166 lines (141 loc) · 4.53 KB
/
violet-build.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
name: CI
on:
pull_request:
branches:
- "dev"
merge_group:
workflow_dispatch:
jobs:
app-changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- ".github/workflows/violet-build.yml"
- "violet/**"
app-format:
needs: app-changes
if: ${{ needs.app-changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: violet
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- uses: actions/setup-java@v1
with:
java-version: "17.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
flutter-version: 3.24.2
- uses: dtolnay/rust-toolchain@stable
- name: Formatting
run: dart format --output=none --set-exit-if-changed .
- name: Preprocess
run: |
cd lib/server
wget -q ${{ secrets.SECRET_SALT }} || echo 'String getValid(String vToken) { return vToken; }' > salt.dart
wget -q ${{ secrets.SECRET_WSALT }} || echo 'String getValid(String vToken) { return vToken; }' > wsalt.dart
- name: Analyze
run: flutter analyze --no-fatal-infos
app-ios-build:
runs-on: macos-latest
needs: [app-format, app-changes]
if: ${{ needs.app-changes.outputs.src == 'true' }}
defaults:
run:
working-directory: violet
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: 3.24.2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: dtolnay/rust-toolchain@stable
- name: Preprocess
run: |
cd lib/server
wget -q ${{ secrets.SECRET_SALT }} || echo 'String getValid(String vToken) { return vToken; }' > salt.dart
wget -q ${{ secrets.SECRET_WSALT }} || echo 'String getValid(String vToken) { return vToken; }' > wsalt.dart
cd ../..
python3 preprocess-ios.py
- name: Podfile
run: |
cd ios
rm Podfile.lock
flutter clean
flutter pub get
pod install
pod update
cd ..
- name: Build
run: |
flutter build ios --release --no-codesign
mkdir -p Payload
mv ./build/ios/iphoneos/Runner.app Payload
zip -r -y Payload.zip Payload/Runner.app
mv Payload.zip Payload.ipa
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: ipa-build
path: ./violet/Payload.ipa
app-android-build:
runs-on: ubuntu-latest
needs: [app-format, app-changes]
if: ${{ needs.app-changes.outputs.src == 'true' }}
defaults:
run:
working-directory: violet
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- uses: actions/setup-java@v1
with:
java-version: "17.x"
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: 3.24.2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: dtolnay/rust-toolchain@stable
- name: Preprocess
run: |
cd lib/server
wget -q ${{ secrets.SECRET_SALT }} || echo 'String getValid(String vToken) { return vToken; }' > salt.dart
wget -q ${{ secrets.SECRET_WSALT }} || echo 'String getValid(String vToken) { return vToken; }' > wsalt.dart
cd ../..
python3 preprocess-android.py
- name: Build
run: |
flutter clean
flutter build apk --release
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: apk-build
path: ./violet/build/app/outputs/apk/release/app-release.apk