-
-
Notifications
You must be signed in to change notification settings - Fork 31
180 lines (146 loc) · 4.99 KB
/
release.yml
File metadata and controls
180 lines (146 loc) · 4.99 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
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
name: Release
on:
push:
tags:
- "*"
permissions:
contents: write
env:
flutter-version: 3.29.3
jobs:
changelogFile:
name: Generate changelog file
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "main"
- name: Generate a changelog
uses: orhun/git-cliff-action@v3
with:
config: cliff.toml
args: --verbose --tag ${{ github.ref_name }}
env:
OUTPUT: CHANGELOG.md
- name: Commit
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add CHANGELOG.md
git commit -m "Update changelog"
git push
build-android:
name: Build Android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter-version }}
cache: true
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: "temurin"
- name: Decode Keystore
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/keystore.jks
- name: Create key.properties
run: |
echo "${{ secrets.KEY_PROPERTIES }}" > android/key.properties
- name: Install dependencies
run: flutter pub get
- name: Build Android
run: |
flutter build apk
flutter build apk --split-per-abi --target-platform=android-arm64
flutter build apk --split-per-abi --target-platform=android-arm
flutter build apk --split-per-abi --target-platform=android-x64
- name: Rename .apk
run: |
cd build/app/outputs/flutter-apk
mv app-release.apk ciyue-universal-release.apk
mv app-armeabi-v7a-release.apk ciyue-armeabi-v7a-release.apk
mv app-arm64-v8a-release.apk ciyue-arm64-v8a-release.apk
mv app-x86_64-release.apk ciyue-x86_64-release.apk
- uses: actions/upload-artifact@v4
with:
name: APKs
path: build/app/outputs/flutter-apk/ciyue-*-release.apk
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter-version }}
cache: true
- name: Install dependencies
run: flutter pub get
- name: Build Windows
run: flutter build windows
- name: Copy DLLs
run: |
Copy-Item "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.42.34433\x64\Microsoft.VC143.CRT\vcruntime140.dll" build/windows/x64/runner/Release/
Copy-Item "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.42.34433\x64\Microsoft.VC143.CRT\vcruntime140_1.dll" build/windows/x64/runner/Release/
Copy-Item "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.42.34433\x64\Microsoft.VC143.CRT\msvcp140.dll" build/windows/x64/runner/Release/
- name: Install Inno Setup
run: choco install innosetup -y
- name: Build Installer
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" ciyue.iss
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: Windows-Installer
path: ciyue-installer.exe
- name: Compression
run: Compress-Archive -Path build/windows/x64/runner/Release/* -DestinationPath ciyue-windows.zip
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Windows
path: ciyue-windows.zip
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter-version }}
cache: true
- name: Install dependencies
run: |
sudo apt update -y
sudo apt install -y libgtk-3-dev
flutter pub get
- name: Build Linux
run: flutter build linux
- name: Compression
run: tar -cJvf ciyue-linux.tar.xz build/linux/x64/release/bundle/*
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Linux
path: ciyue-linux.tar.xz
release:
name: Release
runs-on: ubuntu-latest
needs: [build-android, build-windows, build-linux]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
- uses: ncipollo/release-action@v1
with:
artifacts: "APKs/ciyue-*-release.apk,Windows/ciyue-windows.zip,Windows-Installer/ciyue-installer.exe,Linux/ciyue-linux.tar.xz"
tag: ${{ github.ref_name }}